1
0
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:
Jeff Mitchell 2011-05-03 08:03:01 -04:00
parent 5b0ed433f5
commit 085e6f11bd

View File

@ -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;
}