Jelajahi Sumber

VPDC: add missing main thread guard

(cherry picked from commit 816ec9a43b22d6c4e3f2bdffc9768981051c6e23)
Felix Paul Kühne 9 tahun lalu
induk
melakukan
10ca7a3ab9
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      Sources/VLCPlayerDisplayController.m

+ 4 - 0
Sources/VLCPlayerDisplayController.m

@@ -259,6 +259,10 @@ static NSString *const VLCPlayerDisplayControllerDisplayModeKey = @"VLCPlayerDis
 
 - (void)_closeFullscreenPlayback
 {
+    if (![NSThread isMainThread]) {
+        [self performSelectorOnMainThread:@selector(_closeFullscreenPlayback) withObject:nil waitUntilDone:NO];
+        return;
+    }
     BOOL animated = [self shouldAnimate];
     [self.movieViewController dismissViewControllerAnimated:animated completion:nil];
     [self _showHideMiniPlaybackView];