[vlc-commits] Qt: don't crash if sql ML module is missing

Francois Cartegnie git at videolan.org
Tue Jul 31 19:52:53 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jul 31 19:51:01 2012 +0200| [e43c3cd8a8029ce1b9c46b3b8e776a5745c9af26] | committer: Francois Cartegnie

Qt: don't crash if sql ML module is missing

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

 modules/gui/qt4/components/playlist/ml_model.cpp |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/gui/qt4/components/playlist/ml_model.cpp b/modules/gui/qt4/components/playlist/ml_model.cpp
index a4d3be4..50b8bc0 100644
--- a/modules/gui/qt4/components/playlist/ml_model.cpp
+++ b/modules/gui/qt4/components/playlist/ml_model.cpp
@@ -62,6 +62,8 @@ MLModel::MLModel( intf_thread_t* _p_intf, QObject *parent )
         :VLCModel( _p_intf, parent )
 {
     p_ml = ml_Get( p_intf );
+    if ( !p_ml ) return;
+
     vlc_array_t *p_result_array = vlc_array_new();
     ml_Find( p_ml, p_result_array, ML_MEDIA );
     insertResultArray( p_result_array );
@@ -76,6 +78,7 @@ MLModel::MLModel( intf_thread_t* _p_intf, QObject *parent )
  */
 MLModel::~MLModel()
 {
+    if ( !p_ml ) return;
     var_DelCallback( p_ml, "media-meta-change", mediaUpdated, this );
     var_DelCallback( p_ml, "media-deleted", mediaDeleted, this );
     var_DelCallback( p_ml, "media-added", mediaAdded, this );



More information about the vlc-commits mailing list