Skip to content

Commit

Permalink
Fix for issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
madwizard-thomas committed Jun 21, 2014
1 parent 0e2e3a5 commit f21c239
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion WinUSBNet/DeviceNotifyHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ internal void OnHandleDestroyed(object sender, EventArgs e)
{
// Window was destroyed, release hook.
ReleaseHandle();
if (_notifyHandle != null)
if (_notifyHandle != IntPtr.Zero)
{
API.DeviceManagement.StopDeviceDeviceNotifications(_notifyHandle);
_notifyHandle = IntPtr.Zero;
Expand Down Expand Up @@ -109,6 +109,7 @@ protected virtual void Dispose(bool disposing)
if (_notifyHandle != IntPtr.Zero)
{
API.DeviceManagement.StopDeviceDeviceNotifications(_notifyHandle);
_notifyHandle = IntPtr.Zero;
}
}

Expand Down

0 comments on commit f21c239

Please sign in to comment.