退出时,释放USB监视器对象中的USB设备对象

This commit is contained in:
gb 2023-08-07 15:17:15 +08:00
parent d3af46fefa
commit caf88fadcc
1 changed files with 6 additions and 0 deletions

View File

@ -1217,6 +1217,12 @@ void usb_monitor::quit(void)
{ {
PostMessage(wnd_monitor_, WM_QUIT, 0, 0); PostMessage(wnd_monitor_, WM_QUIT, 0, 0);
} }
{
std::lock_guard<std::mutex> lock(lock_);
for (auto& v : devices_)
v->release();
}
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////