Index: dart/runtime/bin/eventhandler_macos.cc |
diff --git a/dart/runtime/bin/eventhandler_macos.cc b/dart/runtime/bin/eventhandler_macos.cc |
index 49ec2477e19b132b0033d078f664a68787d0c207..29617cd2df2acb7e554d795ac95b65e3aaee0c5c 100644 |
--- a/dart/runtime/bin/eventhandler_macos.cc |
+++ b/dart/runtime/bin/eventhandler_macos.cc |
@@ -358,6 +358,7 @@ void EventHandlerImplementation::EventHandlerEntry(uword args) { |
EventHandler* handler = reinterpret_cast<EventHandler*>(args); |
EventHandlerImplementation* handler_impl = &handler->delegate_; |
ASSERT(handler_impl != NULL); |
+ |
while (!handler_impl->shutdown_) { |
int64_t millis = handler_impl->GetTimeout(); |
ASSERT(millis == kInfinityTimeout || millis >= 0); |
@@ -387,14 +388,14 @@ void EventHandlerImplementation::EventHandlerEntry(uword args) { |
handler_impl->HandleEvents(events, result); |
} |
} |
- delete handler; |
+ handler->NotifyShutdownDone(); |
} |
void EventHandlerImplementation::Start(EventHandler* handler) { |
int result = |
Thread::Start(&EventHandlerImplementation::EventHandlerEntry, |
- reinterpret_cast<uword>(handler)); |
+ reinterpret_cast<uword>(handler)); |
if (result != 0) { |
FATAL1("Failed to start event handler thread %d", result); |
} |