summaryrefslogtreecommitdiff
path: root/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m
diff options
context:
space:
mode:
authorSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-08-17 20:06:59 +0000
committerSND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-08-17 20:06:59 +0000
commit37ba81a540460a7d34a33c23d2353ac84f887576 (patch)
tree64490fe788c3efbc894bc4e418e098e8696a8040 /macosx/plugins/Bladesio1/macsrc/PluginConfigController.m
parent30195666f40ca64b0bdf34ed783215d27f000cd7 (diff)
downloadpcsxr-37ba81a540460a7d34a33c23d2353ac84f887576.tar.gz
Make more plug-ins use and implement RunOnMainThreadSync.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86706 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/plugins/Bladesio1/macsrc/PluginConfigController.m')
-rwxr-xr-xmacosx/plugins/Bladesio1/macsrc/PluginConfigController.m18
1 files changed, 11 insertions, 7 deletions
diff --git a/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m
index 584f58a6..1090df6f 100755
--- a/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m
+++ b/macosx/plugins/Bladesio1/macsrc/PluginConfigController.m
@@ -72,23 +72,27 @@ void AboutDlgProc()
RELEASEOBJ(infoPaneDict);
}
+static inline void RunOnMainThreadSync(dispatch_block_t block)
+{
+ if ([NSThread isMainThread]) {
+ block();
+ } else {
+ dispatch_sync(dispatch_get_main_queue(), block);
+ }
+}
+
void ConfDlgProc()
{
__block NSWindow *window;
__block PluginConfigController *tmpWindowController = nil;
//We need this block due to the xib's use of auto layout
- dispatch_block_t getWindowBlock = ^{
+ RunOnMainThreadSync(^{
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;
}