Permalink
Browse files

Merge pull request #5299 from ace20022/unregdev

[win32][Fix] Set hDeviceNotify to 0 after a successful UnregisterDeviceN...
  • Loading branch information...
2 parents a21c7da + fbb9bb7 commit 44ce38d45c865d8c890143087c2aac396c2fb8cb @jmarshallnz jmarshallnz committed Sep 2, 2014
Showing with 6 additions and 1 deletion.
  1. +6 −1 xbmc/windowing/windows/WinEventsWin32.cpp
@@ -434,7 +434,12 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
case WM_QUIT:
case WM_DESTROY:
if (hDeviceNotify)
- UnregisterDeviceNotification(hDeviceNotify);
+ {
+ if (UnregisterDeviceNotification(hDeviceNotify))
+ hDeviceNotify = 0;
+ else
+ CLog::Log(LOGNOTICE, "%s: UnregisterDeviceNotification failed (%d)", __FUNCTION__, GetLastError());
+ }
newEvent.type = XBMC_QUIT;
m_pEventFunc(newEvent);
break;

0 comments on commit 44ce38d

Please sign in to comment.