diff --git a/README.md b/README.md index ae38f5a..fa78ce6 100644 --- a/README.md +++ b/README.md @@ -118,3 +118,7 @@ nsfw.actions = { ## Installation NSFW is a native node module and requires Node-Gyp to be functional before you can install it. Make sure you have completed installing all of the dependencies listed for [Node-Gyp](https://github.com/nodejs/node-gyp) on your operating system. + +## Breaking changes +Prior to version 2.3.0 when the service receive an error, the service is shutdown but the watcher is not stopped. +Now when the service receives an error, the watcher stops releasing all resources, so if you try to stop the service after an error, you will get an exception. \ No newline at end of file diff --git a/js/spec/index-spec.js b/js/spec/index-spec.js index 085719a..b84b8ed 100644 --- a/js/spec/index-spec.js +++ b/js/spec/index-spec.js @@ -558,7 +558,6 @@ describe('Node Sentinel File Watcher', function() { assert.ok(erroredOut); } finally { - await watch.stop(); watch = null; } }); diff --git a/src/NSFW.cpp b/src/NSFW.cpp index 0a1807a..3f29657 100644 --- a/src/NSFW.cpp +++ b/src/NSFW.cpp @@ -293,6 +293,9 @@ void NSFW::pollForEvents() { std::lock_guard lock(mRunningLock); mRunning = false; } + mInterface.reset(nullptr); + mPollThread.detach(); + Unref(); break; }