fix waitForValid to return once time has been shutdown
This commit is contained in:
parent
700b225f8d
commit
0e30d5709a
|
@ -204,7 +204,7 @@ bool Time::waitForValid()
|
|||
bool Time::waitForValid(const ros::WallDuration& timeout)
|
||||
{
|
||||
ros::WallTime start = ros::WallTime::now();
|
||||
while (!isValid())
|
||||
while (!isValid() && !g_stopped)
|
||||
{
|
||||
ros::WallDuration(0.01).sleep();
|
||||
|
||||
|
@ -214,6 +214,11 @@ bool Time::waitForValid(const ros::WallDuration& timeout)
|
|||
}
|
||||
}
|
||||
|
||||
if (g_stopped)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue