]> git.sesse.net Git - vlc/commitdiff
Incref/decref input_item to avoid eventual segfaults
authorJean-Philippe Andre <jpeg@via.ecp.fr>
Fri, 12 Sep 2008 02:06:09 +0000 (22:06 -0400)
committerJean-Philippe Andre <jpeg@via.ecp.fr>
Fri, 12 Sep 2008 05:03:22 +0000 (01:03 -0400)
modules/gui/qt4/components/interface_widgets.hpp

index 535ca32d020635cdeba89947d78a6bb32558a5ca..f6dd9240d5f24e1bd06caecd6799884151b9d970 100644 (file)
@@ -390,7 +390,9 @@ private:
 public slots:
     void requestUpdate() { emit updateRequested(); };
     void update( input_item_t* p_item )
-            { p_input = p_item; requestUpdate(); }
+            { if( p_input ) vlc_gc_decref( p_input );
+              if( ( p_input = p_item ) ) vlc_gc_incref( p_input );
+              requestUpdate(); }
 
 private slots:
     void doUpdate();