mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 14:46:33 +02:00
All QSharedPointers used in different threads need deleteLater as custom deleter. This is some of them.
(cherry picked from commit e3f5605c4e
)
This commit is contained in:
@@ -61,7 +61,7 @@ Album::get( unsigned int id, const QString& name, const Tomahawk::artist_ptr& ar
|
|||||||
return s_albums.value( id );
|
return s_albums.value( id );
|
||||||
}
|
}
|
||||||
|
|
||||||
album_ptr a = album_ptr( new Album( id, name, artist ) );
|
album_ptr a = album_ptr( new Album( id, name, artist ), &QObject::deleteLater );
|
||||||
if ( id > 0 )
|
if ( id > 0 )
|
||||||
s_albums.insert( id, a );
|
s_albums.insert( id, a );
|
||||||
|
|
||||||
|
@@ -61,7 +61,7 @@ Artist::get( unsigned int id, const QString& name )
|
|||||||
return s_artists.value( id );
|
return s_artists.value( id );
|
||||||
}
|
}
|
||||||
|
|
||||||
artist_ptr a = artist_ptr( new Artist( id, name ) );
|
artist_ptr a = artist_ptr( new Artist( id, name ), &QObject::deleteLater );
|
||||||
if ( id > 0 )
|
if ( id > 0 )
|
||||||
s_artists.insert( id, a );
|
s_artists.insert( id, a );
|
||||||
|
|
||||||
|
@@ -142,7 +142,7 @@ DatabaseCollection::autoPlaylistCreated( const source_ptr& source, const QVarian
|
|||||||
static_cast<GeneratorMode>(data[6].toInt()), // dynamic mode
|
static_cast<GeneratorMode>(data[6].toInt()), // dynamic mode
|
||||||
data[7].toBool(), //shared
|
data[7].toBool(), //shared
|
||||||
data[8].toInt(), //lastmod
|
data[8].toInt(), //lastmod
|
||||||
data[9].toString() ) ); //GUID
|
data[9].toString() ), &QObject::deleteLater ); //GUID
|
||||||
addAutoPlaylist( p );
|
addAutoPlaylist( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ DatabaseCollection::stationCreated( const source_ptr& source, const QVariantList
|
|||||||
static_cast<GeneratorMode>(data[6].toInt()), // dynamic mode
|
static_cast<GeneratorMode>(data[6].toInt()), // dynamic mode
|
||||||
data[7].toBool(), //shared
|
data[7].toBool(), //shared
|
||||||
data[8].toInt(), //lastmod
|
data[8].toInt(), //lastmod
|
||||||
data[9].toString() ) ); //GUID
|
data[9].toString() ), &QObject::deleteLater ); //GUID
|
||||||
addStation( p );
|
addStation( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -71,7 +71,7 @@ DatabaseCommand_LoadAllPlaylists::exec( DatabaseImpl* dbi )
|
|||||||
query.value(5).toBool(), //shared
|
query.value(5).toBool(), //shared
|
||||||
query.value(4).toInt(), //lastmod
|
query.value(4).toInt(), //lastmod
|
||||||
query.value(0).toString() //GUID
|
query.value(0).toString() //GUID
|
||||||
) );
|
), &QObject::deleteLater );
|
||||||
plists.append( p );
|
plists.append( p );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -185,7 +185,7 @@ Playlist::create( const source_ptr& author,
|
|||||||
entries << p;
|
entries << p;
|
||||||
}
|
}
|
||||||
|
|
||||||
playlist_ptr playlist( new Playlist( author, guid, title, info, creator, shared, entries ) );
|
playlist_ptr playlist( new Playlist( author, guid, title, info, creator, shared, entries ), &QObject::deleteLater );
|
||||||
|
|
||||||
// save to DB in the background
|
// save to DB in the background
|
||||||
// Watch for the created() signal if you need to be sure it's written.
|
// Watch for the created() signal if you need to be sure it's written.
|
||||||
|
@@ -152,7 +152,7 @@ DynamicPlaylist::create( const Tomahawk::source_ptr& author,
|
|||||||
bool autoLoad
|
bool autoLoad
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
dynplaylist_ptr dynplaylist = Tomahawk::dynplaylist_ptr( new DynamicPlaylist( author, guid, title, info, creator, type, mode, shared, autoLoad ) );
|
dynplaylist_ptr dynplaylist = Tomahawk::dynplaylist_ptr( new DynamicPlaylist( author, guid, title, info, creator, type, mode, shared, autoLoad ), &QObject::deleteLater );
|
||||||
|
|
||||||
DatabaseCommand_CreateDynamicPlaylist* cmd = new DatabaseCommand_CreateDynamicPlaylist( author, dynplaylist, autoLoad );
|
DatabaseCommand_CreateDynamicPlaylist* cmd = new DatabaseCommand_CreateDynamicPlaylist( author, dynplaylist, autoLoad );
|
||||||
connect( cmd, SIGNAL(finished()), dynplaylist.data(), SIGNAL(created()) );
|
connect( cmd, SIGNAL(finished()), dynplaylist.data(), SIGNAL(created()) );
|
||||||
|
@@ -44,7 +44,7 @@ Query::get( const QString& artist, const QString& track, const QString& album, c
|
|||||||
if ( qid.isEmpty() )
|
if ( qid.isEmpty() )
|
||||||
autoResolve = false;
|
autoResolve = false;
|
||||||
|
|
||||||
query_ptr q = query_ptr( new Query( artist, track, album, qid, autoResolve ) );
|
query_ptr q = query_ptr( new Query( artist, track, album, qid, autoResolve ), &QObject::deleteLater );
|
||||||
q->setWeakRef( q.toWeakRef() );
|
q->setWeakRef( q.toWeakRef() );
|
||||||
|
|
||||||
if ( autoResolve )
|
if ( autoResolve )
|
||||||
@@ -58,7 +58,7 @@ query_ptr
|
|||||||
Query::get( const QString& query, const QID& qid )
|
Query::get( const QString& query, const QID& qid )
|
||||||
{
|
{
|
||||||
|
|
||||||
query_ptr q = query_ptr( new Query( query, qid ) );
|
query_ptr q = query_ptr( new Query( query, qid ), &QObject::deleteLater );
|
||||||
q->setWeakRef( q.toWeakRef() );
|
q->setWeakRef( q.toWeakRef() );
|
||||||
|
|
||||||
if ( !qid.isEmpty() )
|
if ( !qid.isEmpty() )
|
||||||
|
@@ -43,7 +43,7 @@ Result::get( const QString& url )
|
|||||||
return s_results.value( url );
|
return s_results.value( url );
|
||||||
}
|
}
|
||||||
|
|
||||||
result_ptr r = result_ptr( new Result( url ) );
|
result_ptr r = result_ptr( new Result( url ), &QObject::deleteLater );
|
||||||
s_results.insert( url, r );
|
s_results.insert( url, r );
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
Reference in New Issue
Block a user