[vlc-commits] macosx: Make sure core dialogs xib is loaded on main thread

David Fuhrmann git at videolan.org
Sun Oct 15 21:08:38 CEST 2017


vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Oct 15 21:05:50 2017 +0200| [719f45f46d2e9dbc5f615201e816c5ccaced695e] | committer: David Fuhrmann

macosx: Make sure core dialogs xib is loaded on main thread

In some situations, the xib was loaded from another thread as the
getter was used there, first. This is not allowed and leads to
crashes.
Problem was mainly noticable when a invalid file was opened and
the error panel was triggered.

fix #18917

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=719f45f46d2e9dbc5f615201e816c5ccaced695e
---

 modules/gui/macosx/intf.m | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 4bf1dc78ff..204f61df20 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -687,6 +687,10 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     o_open = [[VLCOpen alloc] init];
     o_coredialogs = [[VLCCoreDialogProvider alloc] init];
+    if (!nib_coredialogs_loaded) {
+        nib_coredialogs_loaded = [NSBundle loadNibNamed:@"CoreDialogs" owner: NSApp];
+    }
+
     o_mainmenu = [[VLCMainMenu alloc] init];
     o_coreinteraction = [[VLCCoreInteraction alloc] init];
     o_eyetv = [[VLCEyeTVController alloc] init];
@@ -1769,10 +1773,6 @@ static bool f_appExit = false;
 
 - (id)coreDialogProvider
 {
-    if (!nib_coredialogs_loaded) {
-        nib_coredialogs_loaded = [NSBundle loadNibNamed:@"CoreDialogs" owner: NSApp];
-    }
-
     return o_coredialogs;
 }
 



More information about the vlc-commits mailing list