[vlc-devel] commit: qtcapture: Make sure we don't block on main thread at destruction. (Pierre d'Herbemont )
git version control
git at videolan.org
Mon Dec 28 03:03:10 CET 2009
vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Mon Dec 28 03:01:53 2009 +0100| [c4d1a91a89e2969dd3a825b25532984c0b66be89] | committer: Pierre d'Herbemont
qtcapture: Make sure we don't block on main thread at destruction.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c4d1a91a89e2969dd3a825b25532984c0b66be89
---
modules/access/qtcapture.m | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/access/qtcapture.m b/modules/access/qtcapture.m
index 712385f..f6665eb 100644
--- a/modules/access/qtcapture.m
+++ b/modules/access/qtcapture.m
@@ -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 );
More information about the vlc-devel
mailing list