diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-10-04 11:28:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-10-04 13:15:32 (GMT) |
commit | 68277e16c474ca48e4aabd36603fd9ec4466fe28 (patch) | |
tree | 6896dcfd4a2dfa6e996589535f9b65346b3b0f14 /Source/cmFileMonitor.cxx | |
parent | b99bbfe88d1bb02dc903507f3e1bbe716ac04c12 (diff) | |
download | CMake-68277e16c474ca48e4aabd36603fd9ec4466fe28.zip CMake-68277e16c474ca48e4aabd36603fd9ec4466fe28.tar.gz CMake-68277e16c474ca48e4aabd36603fd9ec4466fe28.tar.bz2 |
server-mode: Improve shutdown behavior
Add a signal handler to trigger shutdown and be more paranoid about
libuv doing things asynchronously. This should fix test cases not
shutting down properly.
Diffstat (limited to 'Source/cmFileMonitor.cxx')
-rw-r--r-- | Source/cmFileMonitor.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx index b97590b..41ec8b4 100644 --- a/Source/cmFileMonitor.cxx +++ b/Source/cmFileMonitor.cxx @@ -12,7 +12,7 @@ namespace { void on_directory_change(uv_fs_event_t* handle, const char* filename, int events, int status); -void on_handle_close(uv_handle_t* handle); +void on_fs_close(uv_handle_t* handle); } // namespace class cmIBaseWatcher @@ -177,7 +177,7 @@ public: { if (this->Handle) { uv_fs_event_stop(this->Handle); - uv_close(reinterpret_cast<uv_handle_t*>(this->Handle), &on_handle_close); + uv_close(reinterpret_cast<uv_handle_t*>(this->Handle), &on_fs_close); this->Handle = nullptr; } cmVirtualDirectoryWatcher::StopWatching(); @@ -292,9 +292,9 @@ void on_directory_change(uv_fs_event_t* handle, const char* filename, watcher->Trigger(pathSegment, events, status); } -void on_handle_close(uv_handle_t* handle) +void on_fs_close(uv_handle_t* handle) { - delete (reinterpret_cast<uv_fs_event_t*>(handle)); + delete reinterpret_cast<uv_fs_event_t*>(handle); } } // namespace |