Commit bfb26c0e authored by Rémi Duraffort's avatar Rémi Duraffort

qt4: delete the callbacks only if they already exist.

parent ae41cb9d
...@@ -91,7 +91,7 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */ ...@@ -91,7 +91,7 @@ PLModel::PLModel( playlist_t *_p_playlist, /* THEPL */
ADD_ICON( NODE, ":/type/node" ); ADD_ICON( NODE, ":/type/node" );
#undef ADD_ICON #undef ADD_ICON
rebuild( p_root ); rebuild( p_root, true );
CONNECT( THEMIM->getIM(), metaChanged( input_item_t *), CONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
this, processInputItemUpdate( input_item_t *) ); this, processInputItemUpdate( input_item_t *) );
CONNECT( THEMIM, inputChanged( input_thread_t * ), CONNECT( THEMIM, inputChanged( input_thread_t * ),
...@@ -707,14 +707,18 @@ end: ...@@ -707,14 +707,18 @@ end:
void PLModel::rebuild() void PLModel::rebuild()
{ {
rebuild( NULL ); rebuild( NULL, false );
} }
void PLModel::rebuild( playlist_item_t *p_root ) void PLModel::rebuild( playlist_item_t *p_root, bool b_first )
{ {
playlist_item_t* p_item; playlist_item_t* p_item;
/* Remove callbacks before locking to avoid deadlocks */ /* 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(); delCallbacks();
/* Invalidate cache */ /* Invalidate cache */
i_cached_id = i_cached_input_id = -1; i_cached_id = i_cached_input_id = -1;
......
...@@ -125,7 +125,7 @@ public: ...@@ -125,7 +125,7 @@ public:
void sort( int column, Qt::SortOrder order ); void sort( int column, Qt::SortOrder order );
void sort( int i_root_id, int column, Qt::SortOrder order ); void sort( int i_root_id, int column, Qt::SortOrder order );
void removeItem( int ); void removeItem( int );
void rebuild(); void rebuild( playlist_item_t * ); void rebuild(); void rebuild( playlist_item_t *, bool b_first = false );
private: private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment