[vlc-commits] lua: Join all threads

Hugo Beauzée-Luyssen git at videolan.org
Thu Mar 30 13:56:31 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Mar 27 17:01:24 2017 +0200| [67464ac6867665444d3c9b9110856df69db4df61] | committer: Hugo Beauzée-Luyssen

lua: Join all threads

Not only the active ones.

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

 modules/lua/extension.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/lua/extension.c b/modules/lua/extension.c
index 32009cc..6eb4411 100644
--- a/modules/lua/extension.c
+++ b/modules/lua/extension.c
@@ -151,23 +151,18 @@ void Close_Extension( vlc_object_t *p_this )
         if( !p_ext ) break;
         msg_Dbg( p_mgr, "Deactivating '%s'", p_ext->psz_title );
         Deactivate( p_mgr, p_ext );
-        vlc_join( p_ext->p_sys->thread, NULL );
     }
     FOREACH_END()
 
     msg_Dbg( p_mgr, "All extensions are now deactivated" );
     ARRAY_RESET( p_mgr->p_sys->activated_extensions );
 
-    vlc_mutex_destroy( &p_mgr->lock );
-    vlc_mutex_destroy( &p_mgr->p_sys->lock );
-    free( p_mgr->p_sys );
-    p_mgr->p_sys = NULL;
-
     /* Free extensions' memory */
     FOREACH_ARRAY( p_ext, p_mgr->extensions )
     {
         if( !p_ext )
             break;
+        vlc_join( p_ext->p_sys->thread, NULL );
         if( p_ext->p_sys->L )
             lua_close( p_ext->p_sys->L );
         free( p_ext->psz_name );
@@ -189,6 +184,11 @@ void Close_Extension( vlc_object_t *p_this )
     }
     FOREACH_END()
 
+    vlc_mutex_destroy( &p_mgr->lock );
+    vlc_mutex_destroy( &p_mgr->p_sys->lock );
+    free( p_mgr->p_sys );
+    p_mgr->p_sys = NULL;
+
     ARRAY_RESET( p_mgr->extensions );
 }
 



More information about the vlc-commits mailing list