diff options
author | Wei Shuai <cpuwolf@gmail.com> | 2018-02-09 11:38:37 +0800 |
---|---|---|
committer | Wei Shuai <cpuwolf@gmail.com> | 2018-02-09 19:47:44 +0800 |
commit | aeed0832326aa7245db189a3f336fe4df81d7142 (patch) | |
tree | 90477954a83d33bbb017ff3eb821221a82022a39 /tracker-wii | |
parent | 3f1cdb4f4059200b51648c1de619c4237544e68d (diff) |
tracker/wii: wiiyourself bug: no where to release write thread handle
Diffstat (limited to 'tracker-wii')
-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) |