[vlc-devel] commit: Qt4: don't "leak" playlist items (Jakob Leben )

git version control git at videolan.org
Mon Nov 2 04:54:25 CET 2009


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Sun Nov  1 20:14:25 2009 +0100| [c650d933f9fa2fba0030b52d404403142d670f59] | committer: Jakob Leben 

Qt4: don't "leak" playlist items

There was opportunity for playlist items not showing up in Qt playlist due to race between playlist rebuilding and item-added, item-removed callbacks
Maybe also fixes some aspects of #2297 or completely - to test.

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

 .../gui/qt4/components/playlist/playlist_model.cpp |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp
index 9b1d7f0..b991e46 100644
--- a/modules/gui/qt4/components/playlist/playlist_model.cpp
+++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
@@ -89,6 +89,7 @@ PLModel::PLModel( playlist_t *_p_playlist,  /* THEPL */
     ADD_ICON( NODE, ":/type/node" );
 #undef ADD_ICON
 
+    addCallbacks();
     rebuild( p_root, true );
     CONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
             this, processInputItemUpdate( input_item_t *) );
@@ -700,11 +701,6 @@ void PLModel::rebuild()
 void PLModel::rebuild( playlist_item_t *p_root, bool b_first )
 {
     playlist_item_t* p_item;
-    /* Remove callbacks before locking to avoid deadlocks
-       The first time the callbacks are not present so
-       don't try to delete them */
-    if( !b_first )
-        delCallbacks();
 
     /* Invalidate cache */
     i_cached_id = i_cached_input_id = -1;
@@ -730,8 +726,6 @@ void PLModel::rebuild( playlist_item_t *p_root, bool b_first )
     reset();
 
     emit currentChanged( index( currentItem, 0 ) );
-
-    addCallbacks();
 }
 
 void PLModel::takeItem( PLItem *item )




More information about the vlc-devel mailing list