mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 14:46:33 +02:00
* Lock mutex when adding to the static hashes in Artist and Album.
This commit is contained in:
@@ -201,9 +201,12 @@ Album::id() const
|
|||||||
m_waitingForId = false;
|
m_waitingForId = false;
|
||||||
|
|
||||||
if ( m_id > 0 )
|
if ( m_id > 0 )
|
||||||
|
{
|
||||||
|
QMutexLocker lock( &s_mutex );
|
||||||
s_albumsById[ m_id ] = m_ownRef.toStrongRef();
|
s_albumsById[ m_id ] = m_ownRef.toStrongRef();
|
||||||
s_idMutex.unlock();
|
}
|
||||||
|
|
||||||
|
s_idMutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
return finalId;
|
return finalId;
|
||||||
|
@@ -280,7 +280,11 @@ Artist::id() const
|
|||||||
m_waitingForFuture = false;
|
m_waitingForFuture = false;
|
||||||
|
|
||||||
if ( m_id > 0 )
|
if ( m_id > 0 )
|
||||||
|
{
|
||||||
|
QMutexLocker lock( &s_mutex );
|
||||||
s_artistsById[ m_id ] = m_ownRef.toStrongRef();
|
s_artistsById[ m_id ] = m_ownRef.toStrongRef();
|
||||||
|
}
|
||||||
|
|
||||||
s_idMutex.unlock();
|
s_idMutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user