mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-05 16:07:27 +02:00
extra NULL check
It is undefined behavior what happens when you try to call pthread_join on a NULL thread (which will happen if you close the game before opening the save browser). Seems to be harmless, but make sure we don't do that just in case --jacob1
This commit is contained in:
@@ -38,6 +38,7 @@ void DownloadManager::Shutdown()
|
|||||||
managerShutdown = true;
|
managerShutdown = true;
|
||||||
pthread_mutex_unlock(&downloadAddLock);
|
pthread_mutex_unlock(&downloadAddLock);
|
||||||
pthread_mutex_unlock(&downloadLock);
|
pthread_mutex_unlock(&downloadLock);
|
||||||
|
if (downloadThread)
|
||||||
pthread_join(downloadThread, NULL);
|
pthread_join(downloadThread, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user