[vlc-devel] commit: Unload interface plugin in StopThread rather than destroy ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Mar 17 19:17:41 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Mar 17 20:14:11 2009 +0200| [352cbd7c4f1750641c7daa3308631b74029449e7] | committer: Rémi Denis-Courmont 

Unload interface plugin in StopThread rather than destroy

That is the same problem as we already had with other object types.
The interface really needs to unload when its owner stops it, not when
the reference counter drops to zero. This fixes a reference dead loop
when an interface yields itself (such as Qt through the view menu) and
a crash if an interface releases itself last (unmapping the running
caller code).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=352cbd7c4f1750641c7daa3308631b74029449e7
---

 src/interface/interface.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/interface/interface.c b/src/interface/interface.c
index 41cb478..ca4ae33 100644
--- a/src/interface/interface.c
+++ b/src/interface/interface.c
@@ -67,10 +67,6 @@ static void intf_Destroy( vlc_object_t *obj )
 {
     intf_thread_t *p_intf = (intf_thread_t *)obj;
 
-    /* Unlock module if present (a switch may have failed) */
-    if( p_intf->p_module )
-        module_unneed( p_intf, p_intf->p_module );
-
     free( p_intf->psz_intf );
     config_ChainDestroy( p_intf->p_cfg );
     vlc_mutex_destroy( &p_intf->change_lock );
@@ -182,6 +178,8 @@ void intf_StopThread( intf_thread_t *p_intf )
     /* Tell the interface to die */
     vlc_object_kill( p_intf );
     vlc_thread_join( p_intf );
+
+    module_unneed( p_intf, p_intf->p_module );
 }
 
 




More information about the vlc-devel mailing list