[vlc-commits] Qt: fix leak in plselector sd

Francois Cartegnie git at videolan.org
Mon May 16 17:11:47 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon May 16 15:54:03 2016 +0200| [e8a7a0364dfab3a4bc3892a2abca55109b95f69e] | committer: Francois Cartegnie

Qt: fix leak in plselector sd

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

 modules/gui/qt/components/playlist/selector.cpp |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt/components/playlist/selector.cpp b/modules/gui/qt/components/playlist/selector.cpp
index a5be6a0..4a0c0e4 100644
--- a/modules/gui/qt/components/playlist/selector.cpp
+++ b/modules/gui/qt/components/playlist/selector.cpp
@@ -366,11 +366,15 @@ void PLSelector::setSource( QTreeWidgetItem *item )
                 return ;
 
             services_discovery_descriptor_t *p_test = new services_discovery_descriptor_t;
-            int i_ret = playlist_ServicesDiscoveryControl( THEPL, qtu( qs ), SD_CMD_DESCRIPTOR, p_test );
-            if ( i_ret != VLC_SUCCESS )
+            if( p_test )
+            {
+                if ( playlist_ServicesDiscoveryControl( THEPL, qtu( qs ),
+                                                        SD_CMD_DESCRIPTOR, p_test ) == VLC_SUCCESS )
+                {
+                    item->setData( 0, CAP_SEARCH_ROLE, (p_test->i_capabilities & SD_CAP_SEARCH) );
+                }
                 delete p_test;
-            else if ( p_test->i_capabilities & SD_CAP_SEARCH )
-                item->setData( 0, CAP_SEARCH_ROLE, true );
+            }
         }
     }
 



More information about the vlc-commits mailing list