]> git.sesse.net Git - vlc/blobdiff - modules/access/qtcapture.m
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / access / qtcapture.m
index 712385f05942d5ac412adabb79441a170d2cfa8c..f6665eb45e07f0131c01c6e01abfdac32da08bfb 100644 (file)
@@ -351,9 +351,11 @@ static void Close( vlc_object_t *p_this )
      * Else we dead lock. */
     if( vlc_object_alive(p_this->p_libvlc))
     {
-        [p_sys->session stopRunning];
-        [p_sys->output release];
-        [p_sys->session release];
+        // Perform this on main thread, as the framework itself will sometimes try to synchronously
+        // work on main thread. And this will create a dead lock.
+        [p_sys->session performSelectorOnMainThread:@selector(stopRunning) withObject:nil waitUntilDone:NO];
+        [p_sys->output performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];
+        [p_sys->session performSelectorOnMainThread:@selector(release) withObject:nil waitUntilDone:NO];
     }
     free( p_sys );