| Index: dart/runtime/bin/eventhandler_linux.cc
|
| diff --git a/dart/runtime/bin/eventhandler_linux.cc b/dart/runtime/bin/eventhandler_linux.cc
|
| index 97b305b61e39d05aff432978f25ef07cf846879a..ba1d88862e68f87a76c9a4b650e051a8f6be0b33 100644
|
| --- a/dart/runtime/bin/eventhandler_linux.cc
|
| +++ b/dart/runtime/bin/eventhandler_linux.cc
|
| @@ -315,6 +315,7 @@ void EventHandlerImplementation::Poll(uword args) {
|
| EventHandler* handler = reinterpret_cast<EventHandler*>(args);
|
| EventHandlerImplementation* handler_impl = &handler->delegate_;
|
| ASSERT(handler_impl != NULL);
|
| +
|
| while (!handler_impl->shutdown_) {
|
| intptr_t result = TEMP_FAILURE_RETRY_NO_SIGNAL_BLOCKER(
|
| epoll_wait(handler_impl->epoll_fd_, events, kMaxEvents, -1));
|
| @@ -327,13 +328,13 @@ void EventHandlerImplementation::Poll(uword args) {
|
| handler_impl->HandleEvents(events, result);
|
| }
|
| }
|
| - delete handler;
|
| + handler->NotifyShutdownDone();
|
| }
|
|
|
|
|
| void EventHandlerImplementation::Start(EventHandler* handler) {
|
| int result = Thread::Start(&EventHandlerImplementation::Poll,
|
| - reinterpret_cast<uword>(handler));
|
| + reinterpret_cast<uword>(handler));
|
| if (result != 0) {
|
| FATAL1("Failed to start event handler thread %d", result);
|
| }
|
|
|