[vlc-commits] qt: remove useless hold/release

Rémi Denis-Courmont git at videolan.org
Thu Feb 28 20:23:27 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Feb 27 21:53:40 2019 +0200| [6912394bae3e04a499d80e0c01edb8d767d4e8f9] | committer: Rémi Denis-Courmont

qt: remove useless hold/release

The following mutex lock is only defined if the strong reference
exists. Taking a weak reference is pointless.

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

 modules/gui/qt/dialogs/plugins.cpp    | 2 --
 modules/gui/qt/extensions_manager.hpp | 4 +---
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/modules/gui/qt/dialogs/plugins.cpp b/modules/gui/qt/dialogs/plugins.cpp
index f9d9304cc6..a4b6025a54 100644
--- a/modules/gui/qt/dialogs/plugins.cpp
+++ b/modules/gui/qt/dialogs/plugins.cpp
@@ -711,7 +711,6 @@ void ExtensionListModel::updateList()
         extensions.append( ext );
     }
     vlc_mutex_unlock( &p_mgr->lock );
-    vlc_object_release( p_mgr );
 
     emit dataChanged( index( 0 ), index( rowCount() - 1 ) );
 }
@@ -726,7 +725,6 @@ int ExtensionListModel::rowCount( const QModelIndex& ) const
     vlc_mutex_lock( &p_mgr->lock );
     count = p_mgr->extensions.i_size;
     vlc_mutex_unlock( &p_mgr->lock );
-    vlc_object_release( p_mgr );
 
     return count;
 }
diff --git a/modules/gui/qt/extensions_manager.hpp b/modules/gui/qt/extensions_manager.hpp
index b50bcb1127..607d167f94 100644
--- a/modules/gui/qt/extensions_manager.hpp
+++ b/modules/gui/qt/extensions_manager.hpp
@@ -62,11 +62,9 @@ public:
     inline bool isUnloading() { return b_unloading; }
     void menu( QMenu *current );
 
-    /** Get the extensions_manager_t if it is loaded and hold the object */
+    /** Get the extensions_manager_t if it is loaded */
     extensions_manager_t* getManager()
     {
-        if( !p_extensions_manager ) return NULL;
-        vlc_object_hold( p_extensions_manager );
         return p_extensions_manager;
     }
 



More information about the vlc-commits mailing list