]> git.sesse.net Git - vlc/commitdiff
Qt4: hold objet while the popup menu is active
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 16 Mar 2009 19:12:08 +0000 (21:12 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 16 Mar 2009 19:12:08 +0000 (21:12 +0200)
modules/gui/qt4/menus.hpp

index 253c84ee52dc04e8c8b1d467f8c5f91d755ca693..46eaab6b4dbbd1b3900d12b8f30bd0bd25946c3b 100644 (file)
@@ -53,6 +53,8 @@ public:
                   vlc_value_t _val, const char *_var ) : QObject( parent )
     {
         p_obj = _p_obj;
+        if( p_obj )
+            vlc_object_hold( p_obj );
         i_val_type = _i_type;
         val = _val;
         psz_var = strdup( _var );
@@ -62,6 +64,8 @@ public:
         free( psz_var );
         if( ( i_val_type & VLC_VAR_TYPE) == VLC_VAR_STRING )
             free( val.psz_string );
+        if( p_obj )
+            vlc_object_release( p_obj );
     }
 
     vlc_object_t *p_obj;