diff options
Diffstat (limited to 'tracker-wii/wiiyourself/wiimote.cpp')
-rw-r--r-- | tracker-wii/wiiyourself/wiimote.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tracker-wii/wiiyourself/wiimote.cpp b/tracker-wii/wiiyourself/wiimote.cpp index 79893027..956c4fc6 100644 --- a/tracker-wii/wiiyourself/wiimote.cpp +++ b/tracker-wii/wiiyourself/wiimote.cpp @@ -2114,6 +2114,14 @@ bool wiimote::WriteReport (BYTE *buff) if(bUseHIDwrite) { + /* no where to release handle, I have to do it myself */ + if (HIDwriteThread) + { + if (WaitForSingleObject(HIDwriteThread, 0) == WAIT_OBJECT_0) { + CloseHandle(HIDwriteThread); + HIDwriteThread = NULL; + } + } // HidD_SetOutputReport: +: works on MS Bluetooth stacks (WriteFile doesn't). // -: is synchronous, so make it async if(!HIDwriteThread) |