Skip to content
Browse files

Mac GUI: let the current run loop iteration finish

before attempting to launch gemrb. fixes the launch button being "stuck"
also much more appropriate (backtrace will be cleaner/shorter etc)
  • Loading branch information...
1 parent b2a7d52 commit 81d9b1a214b090fe7372ac0fc95f833fc01cf052 @bradallred bradallred committed Jun 8, 2013
Showing with 7 additions and 1 deletion.
  1. +7 −1 apple/CocoaWrapper/mac/CocoaWrapper.mm
View
8 apple/CocoaWrapper/mac/CocoaWrapper.mm
@@ -138,12 +138,18 @@ - (IBAction)openGame:(id) __unused sender
}
}
-- (IBAction)launchGame:(id) __unused sender
+- (IBAction)launchGame:(id) sender
{
if (core) {
Log(FATAL, "Launch Game", "GemRB game is currently running. Please close it before trying to open another.");
return;
}
+ if (sender) {
+ // Note: use NSRunLoop over NSObject performSelector!
+ [[NSRunLoop mainRunLoop] performSelector:@selector(launchGame:) target:self argument:nil order:0 modes:@[NSDefaultRunLoopMode]];
+ return;
+ }
+
core = new Interface();
InterfaceConfig* config = new InterfaceConfig(0, NULL);

0 comments on commit 81d9b1a

Please sign in to comment.
Something went wrong with that request. Please try again.