-
Notifications
You must be signed in to change notification settings - Fork 114
Conversation
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.
We probably also need to add these changes to the mac and linux files as well.
@@ -107,10 +107,14 @@ void NotifyAsync(uv_work_t* req) { | |||
void NotifyFinished(uv_work_t* req) { | |||
if (isRunning) { | |||
if(isAdded) { | |||
NotifyAdded(currentDevice); | |||
if (currentDevice != NULL) { |
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.
currentDevice !== null
} | ||
else { | ||
NotifyRemoved(currentDevice); | ||
if (currentDevice != NULL) { |
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.
currentDevice !== null
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "usb-detection", | |||
"version": "1.4.0", | |||
"version": "1.4.1", |
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.
Let's not bump the version in the PR. We can start a release once this gets into master.
I made those changes to the other platforms. It would be a smaller change if we just put the check in detection.cpp. VS Code cleaned up a bunch of spaces at the end of lines. Let me know if you want me to back those out. |
I think this is ready to go. I have tested it on Mac and Windows. I don't have a linux env to test it on. |
@reidmweber Sorry for the delay. My timeline is to review this again over the upcoming weekend. Keep with the pings if it slips. |
I have merged the changes via these two PRs Thanks for the contribution 😀 |
We've been using this in an electron app running in Windows. We were getting a crash about 5-10 minutes into launching the app. We've only been able to reproduce it on one PC. Somehow NotifyRemoved in detection.cpp is getting called with a null device and causing a null ptr exception. The PC has a touchscreen that isn't working so it may be that the touchscreen device is continually connecting and disconnecting to create this scenario.
In any case, this change has fixed the crash for us.