修复登出设备连接释放资源bug
This commit is contained in:
parent
d3f1af9b8b
commit
ad8c4c8674
@ -378,7 +378,7 @@ namespace Assets.Scripts.Ble
|
|||||||
{
|
{
|
||||||
pCache.Clear();
|
pCache.Clear();
|
||||||
_discoveredCallback = discoveredCallBack;
|
_discoveredCallback = discoveredCallBack;
|
||||||
bleMobileThread.StartWatcher();
|
bleMobileThread?.StartWatcher();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StopScan()
|
public void StopScan()
|
||||||
@ -457,12 +457,10 @@ namespace Assets.Scripts.Ble
|
|||||||
{
|
{
|
||||||
if (bleMobileThread == null)
|
if (bleMobileThread == null)
|
||||||
return;
|
return;
|
||||||
bleMobileThread.ManagerInitialized -= BleMobileThread_ManagerInitialized;
|
//bleMobileThread.ManagerInitialized -= BleMobileThread_ManagerInitialized;
|
||||||
bleMobileThread.ManagerStatusChanged -= ManagerStatusChanged;
|
//bleMobileThread.ManagerStatusChanged -= ManagerStatusChanged;
|
||||||
bleMobileThread.ScanInfoReceived -= WatcherScanInfoReceived;
|
//bleMobileThread.ScanInfoReceived -= WatcherScanInfoReceived;
|
||||||
bleMobileThread.Dispose();
|
bleMobileThread.Dispose();
|
||||||
bleMobileThread = null;
|
|
||||||
hwInterface = null;
|
|
||||||
pCache.Clear();
|
pCache.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user