summaryrefslogtreecommitdiff
path: root/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/plugins/Bladesio1/macsrc/PluginConfigController.m')
-rwxr-xr-xmacosx/plugins/Bladesio1/macsrc/PluginConfigController.m9
1 files changed, 7 insertions, 2 deletions
diff --git a/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m
index b1b4c08e..584f58a6 100755
--- a/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m
+++ b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m
@@ -78,12 +78,17 @@ void ConfDlgProc()
__block PluginConfigController *tmpWindowController = nil;
//We need this block due to the xib's use of auto layout
- dispatch_sync(dispatch_get_main_queue(), ^{
+ dispatch_block_t getWindowBlock = ^{
if (windowController == nil) {
tmpWindowController = [[PluginConfigController alloc] initWithWindowNibName:@"Bladesio1PluginConfig"];
}
window = [(windowController ? windowController : tmpWindowController) window];
- });
+ };
+ if ([NSThread isMainThread]) {
+ getWindowBlock();
+ } else {
+ dispatch_sync(dispatch_get_main_queue(), getWindowBlock);
+ }
if (!windowController) {
windowController = tmpWindowController;
}