From 0af4b54bc39e420f04b207e5ebb5adbcd55f93b4 Mon Sep 17 00:00:00 2001 From: SopaXorzTaker Date: Tue, 7 Jun 2016 15:28:53 +0300 Subject: [PATCH] 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 --- src/client/DownloadManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/DownloadManager.cpp b/src/client/DownloadManager.cpp index e82cd447aa..b30ef01277 100644 --- a/src/client/DownloadManager.cpp +++ b/src/client/DownloadManager.cpp @@ -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