1
0
mirror of https://github.com/The-Powder-Toy/The-Powder-Toy.git synced 2025-04-08 08:23:54 +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:
SopaXorzTaker 2016-06-07 15:28:53 +03:00 committed by jacob1
parent c85ac21d84
commit 0af4b54bc3

@ -38,7 +38,8 @@ void DownloadManager::Shutdown()
managerShutdown = true;
pthread_mutex_unlock(&downloadAddLock);
pthread_mutex_unlock(&downloadLock);
pthread_join(downloadThread, NULL);
if (downloadThread)
pthread_join(downloadThread, NULL);
}
//helper function for download