Index: mojo/public/cpp/utility/lib/run_loop.cc |
diff --git a/mojo/public/cpp/utility/lib/run_loop.cc b/mojo/public/cpp/utility/lib/run_loop.cc |
index b06880dc9d6e0a1dbd02aaeb1cb105a9a39bad54..d545ec5fba7da51603113f7ae28f0fb0c6fbdc86 100644 |
--- a/mojo/public/cpp/utility/lib/run_loop.cc |
+++ b/mojo/public/cpp/utility/lib/run_loop.cc |
@@ -99,7 +99,8 @@ void RunLoop::Run() { |
run_state_ = &run_state; |
while (!run_state.should_quit) { |
DoDelayedWork(); |
- Wait(false); |
+ if (!run_state.should_quit) |
+ Wait(false); |
jamesr
2014/09/22 22:30:18
hmm, i think this would be cleaner if it was struc
|
} |
run_state_ = old_state; |
} |
@@ -111,7 +112,7 @@ void RunLoop::RunUntilIdle() { |
run_state_ = &run_state; |
while (!run_state.should_quit) { |
DoDelayedWork(); |
- if (!Wait(true) && delayed_tasks_.empty()) |
+ if (!run_state.should_quit && !Wait(true) && delayed_tasks_.empty()) |
jamesr
2014/09/22 22:30:18
this is getting too hard to follow IMO, especially
qsr
2014/09/23 10:40:15
That would be incorrect though. This must continue
|
break; |
} |
run_state_ = old_state; |