summaryrefslogtreecommitdiffhomepage
path: root/tracker-wii/wiiyourself
diff options
context:
space:
mode:
authorWei Shuai <cpuwolf@gmail.com>2018-02-09 11:38:37 +0800
committerWei Shuai <cpuwolf@gmail.com>2018-02-09 19:47:44 +0800
commitaeed0832326aa7245db189a3f336fe4df81d7142 (patch)
tree90477954a83d33bbb017ff3eb821221a82022a39 /tracker-wii/wiiyourself
parent3f1cdb4f4059200b51648c1de619c4237544e68d (diff)
tracker/wii: wiiyourself bug: no where to release write thread handle
Diffstat (limited to 'tracker-wii/wiiyourself')
-rw-r--r--tracker-wii/wiiyourself/wiimote.cpp8
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)