Skip to content

Commit

Permalink
Fixed shutdown without viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
raulmur committed Jan 4, 2017
1 parent 00f7840 commit 2f1b9b0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/System.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,16 +303,20 @@ void System::Shutdown()
mpLocalMapper->RequestFinish();
mpLoopCloser->RequestFinish();
if(mpViewer)
{
mpViewer->RequestFinish();
while(!mpViewer->isFinished())
usleep(5000);
}

// Wait until all thread have effectively stopped
while(!mpLocalMapper->isFinished() || !mpLoopCloser->isFinished() ||
!mpViewer->isFinished() || mpLoopCloser->isRunningGBA())
while(!mpLocalMapper->isFinished() || !mpLoopCloser->isFinished() || mpLoopCloser->isRunningGBA())
{
usleep(5000);
}

pangolin::BindToContext("ORB-SLAM2: Map Viewer");
if(mpViewer)
pangolin::BindToContext("ORB-SLAM2: Map Viewer");
}

void System::SaveTrajectoryTUM(const string &filename)
Expand Down

0 comments on commit 2f1b9b0

Please sign in to comment.