mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-13 20:39:57 +01:00
A bit more safety -- kind of redundant with the mutex, but doesn't hurt to have it
This commit is contained in:
parent
5b0ed433f5
commit
085e6f11bd
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 );
|
||||
QThread* thread = QThread::currentThread();
|
||||
QNetworkAccessManager* oldNam = 0;
|
||||
if ( threadNamHash.contains( thread ) && ourNamHash.contains( thread ) && ourNamHash[thread] )
|
||||
delete threadNamHash[thread];
|
||||
oldNam = threadNamHash[thread];
|
||||
|
||||
threadNamHash[thread] = nam;
|
||||
ourNamHash[thread] = false;
|
||||
|
||||
if ( oldNam )
|
||||
delete oldNam;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user