Skip to content

Commit

Permalink
extra NULL check
Browse files Browse the repository at this point in the history
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
  • Loading branch information
SopaXorzTaker authored and jacob1 committed Jun 11, 2016
1 parent c85ac21 commit 0af4b54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/DownloadManager.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 0af4b54

Please sign in to comment.