Skip to content

Commit

Permalink
Stop the service on error.
Browse files Browse the repository at this point in the history
This way the watcher will release all RAM used for watching the inodes on linux.
  • Loading branch information
julianmesa-gitkraken committed Feb 2, 2022
1 parent 7421623 commit b3dad2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion js/spec/index-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,6 @@ describe('Node Sentinel File Watcher', function() {

assert.ok(erroredOut);
} finally {
await watch.stop();
watch = null;
}
});
Expand Down
3 changes: 3 additions & 0 deletions src/NSFW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ void NSFW::pollForEvents() {
std::lock_guard<std::mutex> lock(mRunningLock);
mRunning = false;
}
mInterface.reset(nullptr);
mPollThread.detach();
Unref();
break;
}

Expand Down

0 comments on commit b3dad2b

Please sign in to comment.