Skip to content

Commit

Permalink
Fix segmentation fault on linux when calling stopMonitoring()
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsch committed Dec 3, 2019
1 parent ffb0aa6 commit 0e6ba6f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/detection_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ void Stop() {
uv_signal_stop(&term_signal);
uv_close((uv_handle_t *) &async_handler, NULL);
uv_cond_destroy(&notifyDeviceHandled);

udev_monitor_unref(mon);
udev_unref(udev);
}

void InitDetection() {
Expand Down Expand Up @@ -245,6 +242,8 @@ static void cbWork(uv_work_t *req) {

static void cbAfter(uv_work_t *req, int status) {
Stop();
udev_monitor_unref(mon);
udev_unref(udev);
}

static void cbAsync(uv_async_t *handle) {
Expand Down

0 comments on commit 0e6ba6f

Please sign in to comment.