Chromium Code Reviews| Index: runtime/bin/eventhandler_win.cc |
| diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc |
| index 3fb27c7ff5b94bdc87510d145818eeff0d7415d9..7e2eb87eb7773862a75530b0b069d6839768b871 100644 |
| --- a/runtime/bin/eventhandler_win.cc |
| +++ b/runtime/bin/eventhandler_win.cc |
| @@ -388,7 +388,14 @@ void DirectoryWatchHandle::EnsureInitialized( |
| bool DirectoryWatchHandle::IsClosed() { |
| - return IsClosing() && pending_read_ == NULL; |
| + return IsClosing() && pending_read_ == NULL && closed_; |
| +} |
| + |
|
kasperl
2014/06/04 11:37:54
Extra newline here.
|
| +void DirectoryWatchHandle::DoClose() { |
| + if (handle_ != INVALID_HANDLE_VALUE) { |
| + Handle::DoClose(); |
| + } |
| + closed_ = true; |
| } |
| @@ -424,11 +431,11 @@ void DirectoryWatchHandle::Stop() { |
| if (pending_read_ != NULL) { |
| CancelIoEx(handle(), pending_read_->GetCleanOverlapped()); |
| // Don't dispose of the buffer, as it will still complete (with length 0). |
| - pending_read_ = NULL; |
| } |
| - CloseHandle(handle()); |
| - handle_ = (INVALID_HANDLE_VALUE); |
| + // Close handle, but don't mark as closed_. |
|
kasperl
2014/06/04 11:37:54
closed_ -> closed.
|
| + MarkClosing(); |
| + Handle::DoClose(); |
| } |