mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 20:00:13 +02:00
A bit more safety -- kind of redundant with the mutex, but doesn't hurt to have it
This commit is contained in:
6
thirdparty/liblastfm2/src/ws/ws.cpp
vendored
6
thirdparty/liblastfm2/src/ws/ws.cpp
vendored
@@ -218,11 +218,15 @@ lastfm::setNetworkAccessManager( QNetworkAccessManager* nam )
|
|||||||
|
|
||||||
QMutexLocker l( &namAccessMutex );
|
QMutexLocker l( &namAccessMutex );
|
||||||
QThread* thread = QThread::currentThread();
|
QThread* thread = QThread::currentThread();
|
||||||
|
QNetworkAccessManager* oldNam = 0;
|
||||||
if ( threadNamHash.contains( thread ) && ourNamHash.contains( thread ) && ourNamHash[thread] )
|
if ( threadNamHash.contains( thread ) && ourNamHash.contains( thread ) && ourNamHash[thread] )
|
||||||
delete threadNamHash[thread];
|
oldNam = threadNamHash[thread];
|
||||||
|
|
||||||
threadNamHash[thread] = nam;
|
threadNamHash[thread] = nam;
|
||||||
ourNamHash[thread] = false;
|
ourNamHash[thread] = false;
|
||||||
|
|
||||||
|
if ( oldNam )
|
||||||
|
delete oldNam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user