diff options
author | Cedric Borgese <cedric.borgese@gmail.com> | 2005-07-18 19:35:58 +0000 |
---|---|---|
committer | Cedric Borgese <cedric.borgese@gmail.com> | 2005-07-18 19:35:58 +0000 |
commit | 7599b01962a25e79c35fa80549b2833bdc6f92bf (patch) | |
tree | 4925beba22c26fb438127638a368ccbece8537df /src/gui/updatewindow.cpp | |
parent | 95f827e58316c191996ca73a728e082479c22f9f (diff) | |
download | mana-7599b01962a25e79c35fa80549b2833bdc6f92bf.tar.gz mana-7599b01962a25e79c35fa80549b2833bdc6f92bf.tar.bz2 mana-7599b01962a25e79c35fa80549b2833bdc6f92bf.tar.xz mana-7599b01962a25e79c35fa80549b2833bdc6f92bf.zip |
Fix a crash when the updated file are already present on the client
Diffstat (limited to 'src/gui/updatewindow.cpp')
-rw-r--r-- | src/gui/updatewindow.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp index 4911261e..d133ae2b 100644 --- a/src/gui/updatewindow.cpp +++ b/src/gui/updatewindow.cpp @@ -32,9 +32,10 @@ #include <iostream> #include <cstdio> #include <SDL_thread.h> +#include <SDL_mutex.h> UpdaterWindow *updaterWindow; -SDL_Thread *thread; +SDL_Thread *thread = NULL; std::string updateHost = "themanaworld.org/files"; std::string currentFile = "news.txt"; bool downloadComplete = true; @@ -337,7 +338,11 @@ void updateData() break; case UPDATE_RESOURCES: if (downloadComplete) { - SDL_WaitThread(thread, NULL); + if (thread) + { + SDL_WaitThread(thread, NULL); + thread = NULL; + } if (fileIndex < files.size()) { currentFile = files[fileIndex]; |