-
Notifications
You must be signed in to change notification settings - Fork 114
Fixed a crash after stopMonitoring on Linux in Electron #138
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,16 +89,13 @@ void Stop() { | |
return; | ||
} | ||
|
||
isRunning = false; | ||
|
||
uv_mutex_destroy(¬ify_mutex); | ||
uv_signal_stop(&int_signal); | ||
uv_signal_stop(&term_signal); | ||
uv_close((uv_handle_t *) &async_handler, NULL); | ||
uv_cond_destroy(¬ifyDeviceHandled); | ||
|
||
udev_monitor_unref(mon); | ||
udev_unref(udev); | ||
|
||
isRunning = false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there an exact behavior we're going for by moving this below (please explain and document)? Or is just stylistic preference? I could see it maybe mattering if the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I agree that changing |
||
} | ||
|
||
void InitDetection() { | ||
|
@@ -244,6 +241,9 @@ static void cbWork(uv_work_t *req) { | |
} | ||
|
||
static void cbAfter(uv_work_t *req, int status) { | ||
udev_monitor_unref(mon); | ||
udev_unref(udev); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can't we just move these above I assume there is nuance between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from some googling, I think the flow is that after It sounds to me like A follow up question is why does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@Julusian This sounds reasonable 👍
This also seems reasonable as long as those clean-up functions can be called there 🤷 Appreciate the context and confidence here ❤️ |
||
|
||
Stop(); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone wants to submit a new PR with the review addressed and tested, we can move this forward more. Credit still goes to all involved (@antelle 🙇).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding a reference here, too. I think I've made the requested changes: #162