Merge pull request #5626 from shuffle2/fix-leak

windows: fix handle leak when using continuous scan
This commit is contained in:
Pierre Bourdon 2017-06-16 13:03:02 +02:00 committed by GitHub
commit 13b1fa2c65
1 changed files with 2 additions and 0 deletions

View File

@ -476,6 +476,7 @@ bool WiimoteScannerWindows::IsReady() const
if (nullptr != hFindRadio)
{
CloseHandle(hRadio);
pBluetoothFindRadioClose(hFindRadio);
return true;
}
@ -897,6 +898,7 @@ void ProcessWiimotes(bool new_scan, const T& callback)
if (false == pBluetoothFindNextRadio(hFindRadio, &hRadio))
{
CloseHandle(hRadio);
pBluetoothFindRadioClose(hFindRadio);
hFindRadio = nullptr;
}