From 0e30d5709ac6a625743b11c0820988c104325ea2 Mon Sep 17 00:00:00 2001 From: Josh Faust Date: Mon, 14 Jun 2010 21:32:56 +0000 Subject: [PATCH] fix waitForValid to return once time has been shutdown --- core/roslib/src/time.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/roslib/src/time.cpp b/core/roslib/src/time.cpp index 45262726..dfe0de97 100644 --- a/core/roslib/src/time.cpp +++ b/core/roslib/src/time.cpp @@ -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; }