[vlc-commits] macosx: fix crash occuring while initializing the info panel

David Fuhrmann git at videolan.org
Sat Apr 11 20:49:28 CEST 2015


vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sat Apr 11 20:44:50 2015 +0200| [206122658c54d3f3c86eaff0ceb5f9dbff785533] | committer: David Fuhrmann

macosx: fix crash occuring while initializing the info panel

It is not allowed to call [[VLCMain sharedInstance] info]
on the non-main-thread, as this might load and initialize the
info window.

(cherry picked from commit d87928927015fad3cdbcd0309bf3185c3672822f)
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>

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

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

diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index a2ceb07..f59c159 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -367,7 +367,9 @@ static int InputEvent(vlc_object_t *p_this, const char *psz_var,
             [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateMainWindow) withObject: nil waitUntilDone: NO];
             break;
         case INPUT_EVENT_STATISTICS:
-            [[[VLCMain sharedInstance] info] performSelectorOnMainThread:@selector(updateStatistics) withObject: nil waitUntilDone: NO];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [[[VLCMain sharedInstance] info] updateStatistics];
+            });
             break;
         case INPUT_EVENT_ES:
             break;



More information about the vlc-commits mailing list