summaryrefslogtreecommitdiff
path: root/src/gui/updatewindow.cpp
diff options
context:
space:
mode:
authorCedric Borgese <cedric.borgese@gmail.com>2005-07-18 19:35:58 +0000
committerCedric Borgese <cedric.borgese@gmail.com>2005-07-18 19:35:58 +0000
commit7599b01962a25e79c35fa80549b2833bdc6f92bf (patch)
tree4925beba22c26fb438127638a368ccbece8537df /src/gui/updatewindow.cpp
parent95f827e58316c191996ca73a728e082479c22f9f (diff)
downloadmana-client-7599b01962a25e79c35fa80549b2833bdc6f92bf.tar.gz
mana-client-7599b01962a25e79c35fa80549b2833bdc6f92bf.tar.bz2
mana-client-7599b01962a25e79c35fa80549b2833bdc6f92bf.tar.xz
mana-client-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.cpp9
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];