[vlc-devel] commit: Extensions/Qt: use lock on extensions list ( Jean-Philippe André )

git version control git at videolan.org
Thu Jan 28 16:22:14 CET 2010


vlc | branch: master | Jean-Philippe André <jpeg at videolan.org> | Thu Jan 28 12:24:24 2010 +0100| [c11e8245be71ded993f0544230fbf5561b505060] | committer: Jean-Philippe André 

Extensions/Qt: use lock on extensions list

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

 modules/gui/qt4/extensions_manager.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/extensions_manager.cpp b/modules/gui/qt4/extensions_manager.cpp
index acca480..ac99a2d 100644
--- a/modules/gui/qt4/extensions_manager.cpp
+++ b/modules/gui/qt4/extensions_manager.cpp
@@ -119,6 +119,8 @@ void ExtensionsManager::menu( QMenu *current )
     action->setEnabled( false );
     current->addSeparator();
 
+    vlc_mutex_lock( &p_extensions_manager->lock );
+
     extension_t *p_ext = NULL;
     int i_ext = 0;
     FOREACH_ARRAY( p_ext, p_extensions_manager->extensions )
@@ -183,6 +185,8 @@ void ExtensionsManager::menu( QMenu *current )
     }
     FOREACH_END()
 
+    vlc_mutex_unlock( &p_extensions_manager->lock );
+
     /* Possibility to unload the module */
     current->addSeparator();
     current->addAction( QIcon( ":/menu/quit" ), qtr( "Unload extensions" ),
@@ -194,6 +198,8 @@ void ExtensionsManager::triggerMenu( int id )
     uint16_t i_ext = MENU_GET_EXTENSION( id );
     uint16_t i_action = MENU_GET_ACTION( id );
 
+    vlc_mutex_lock( &p_extensions_manager->lock );
+
     if( (int) i_ext > p_extensions_manager->extensions.i_size )
     {
         msg_Dbg( p_intf, "can't trigger extension with wrong id %d",
@@ -204,6 +210,8 @@ void ExtensionsManager::triggerMenu( int id )
     extension_t *p_ext = ARRAY_VAL( p_extensions_manager->extensions, i_ext );
     assert( p_ext != NULL);
 
+    vlc_mutex_unlock( &p_extensions_manager->lock );
+
     if( i_action == 0 )
     {
         msg_Dbg( p_intf, "activating or triggering extension '%s'",




More information about the vlc-devel mailing list