aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform')
-rwxr-xr-xbackends/platform/bada/form.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/backends/platform/bada/form.cpp b/backends/platform/bada/form.cpp
index f75acfed20..92b3f07179 100755
--- a/backends/platform/bada/form.cpp
+++ b/backends/platform/bada/form.cpp
@@ -101,8 +101,12 @@ BadaAppForm::~BadaAppForm() {
if (_gameThread && _state != ErrorState) {
terminate();
+
_gameThread->Stop();
- _gameThread->Join();
+ if (_state != ErrorState) {
+ _gameThread->Join();
+ }
+
delete _gameThread;
_gameThread = null;
}
@@ -136,6 +140,11 @@ void BadaAppForm::terminate() {
for (int i = 0; i < 10 && _state == ClosingState; i++) {
Thread::Sleep(250);
}
+
+ if (_state = ClosingState) {
+ // failed to terminate - Join() will freeze
+ _state = ErrorState;
+ }
}
}