mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-07-29 14:36:06 -04:00
Fix use after free in NetworkClient and NetworkServer
This commit is contained in:
@@ -296,14 +296,14 @@ void NetworkClient::StopClient()
|
||||
/*-----------------------------------------------------*\
|
||||
| Close the ProfileManager listen thread |
|
||||
\*-----------------------------------------------------*/
|
||||
if(profilemanager_thread->thread)
|
||||
if(profilemanager_thread)
|
||||
{
|
||||
profilemanager_thread->online = false;
|
||||
profilemanager_thread->start_cv.notify_all();
|
||||
profilemanager_thread->thread->join();
|
||||
delete profilemanager_thread->thread;
|
||||
profilemanager_thread->thread = nullptr;
|
||||
delete profilemanager_thread;
|
||||
profilemanager_thread = nullptr;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
||||
@@ -567,14 +567,14 @@ void NetworkServer::StopServer()
|
||||
/*-----------------------------------------------------*\
|
||||
| Close the ProfileManager listen thread |
|
||||
\*-----------------------------------------------------*/
|
||||
if(profilemanager_thread->thread)
|
||||
if(profilemanager_thread)
|
||||
{
|
||||
profilemanager_thread->online = false;
|
||||
profilemanager_thread->start_cv.notify_all();
|
||||
profilemanager_thread->thread->join();
|
||||
delete profilemanager_thread->thread;
|
||||
profilemanager_thread->thread = nullptr;
|
||||
delete profilemanager_thread;
|
||||
profilemanager_thread = nullptr;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
||||
Reference in New Issue
Block a user