1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

* Artist id must be >0 when initializing it with pre-loaded data.

This commit is contained in:
Christian Muehlhaeuser
2013-05-16 11:15:51 +02:00
parent d6462dc002
commit d554dbc6fd
2 changed files with 4 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ QHash< unsigned int, artist_wptr > Artist::s_artistsById = QHash< unsigned int,
static QMutex s_nameCacheMutex;
static QReadWriteLock s_idMutex;
Artist::~Artist()
{
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Deleting artist:" << m_name;
@@ -65,7 +66,7 @@ Artist::get( const QString& name, bool autoCreate )
if ( s_artistsByName.contains( key ) )
{
artist_wptr artist = s_artistsByName.value( key );
if ( !artist.isNull() )
if ( artist )
return artist.toStrongRef();
}
@@ -84,6 +85,8 @@ Artist::get( const QString& name, bool autoCreate )
artist_ptr
Artist::get( unsigned int id, const QString& name )
{
Q_ASSERT( id > 0 );
s_idMutex.lockForRead();
if ( s_artistsById.contains( id ) )
{

View File

@@ -31,7 +31,6 @@
#include "DllMacro.h"
#include "Query.h"
class IdThreadWorker;
namespace Tomahawk