[vlc-devel] commit: qtcapture: Don't release objects when libvlc quit, else we may loose our main thread, and dead lock. (Pierre d'Herbemont )
git version control
git at videolan.org
Wed Jul 16 20:47:07 CEST 2008
vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Wed Jul 16 20:49:23 2008 +0200| [bd4bd54dc68f76525ede8700361dc50e5872d376]
qtcapture: Don't release objects when libvlc quit, else we may loose our main thread, and dead lock.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bd4bd54dc68f76525ede8700361dc50e5872d376
---
modules/access/qtcapture.m | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/modules/access/qtcapture.m b/modules/access/qtcapture.m
index fba2fbe..78fb604 100644
--- a/modules/access/qtcapture.m
+++ b/modules/access/qtcapture.m
@@ -317,10 +317,16 @@ static void Close( vlc_object_t *p_this )
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys = p_demux->p_sys;
- [p_sys->session stopRunning];
- [p_sys->output release];
- [p_sys->session release];
- [p_sys->device release];
+ /* Hack: if libvlc was killed, main interface thread was,
+ * and poor QTKit needs it, so don't tell him.
+ * Else we dead lock. */
+ if( vlc_object_alive(p_this->p_libvlc))
+ {
+ [p_sys->session stopRunning];
+ [p_sys->output release];
+ [p_sys->session release];
+ [p_sys->device release];
+ }
free( p_sys );
[pool release];
More information about the vlc-devel
mailing list