Fix use after free in NetworkClient and NetworkServer

This commit is contained in:
isJuhn
2026-07-26 19:45:48 +02:00
committed by Adam Honse
parent acc7fa6754
commit 3b2466ba10
2 changed files with 4 additions and 4 deletions

View File

@@ -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;
}
/*-----------------------------------------------------*\

View File

@@ -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;
}
/*-----------------------------------------------------*\