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

No need for a pointer here

This commit is contained in:
Uwe L. Korn
2013-06-09 19:46:31 +02:00
parent 2cbfcc7952
commit 9e24fc7ddc

View File

@@ -32,14 +32,14 @@
/* Management of ConnectionManagers */
static QMutex* nodeMapMutex = new QMutex();
static QMutex nodeMapMutex;
static QMap< QString, QWeakPointer< ConnectionManager > > connectionManagers;
static QMap< QString, QSharedPointer< ConnectionManager > > activeConnectionManagers;
QSharedPointer<ConnectionManager>
ConnectionManager::getManagerForNodeId( const QString &nodeid )
{
QMutexLocker locker( nodeMapMutex );
QMutexLocker locker( &nodeMapMutex );
if ( connectionManagers.contains( nodeid ) && !connectionManagers.value( nodeid ).isNull() ) {
return connectionManagers.value( nodeid ).toStrongRef();
}
@@ -54,7 +54,7 @@ ConnectionManager::getManagerForNodeId( const QString &nodeid )
void
ConnectionManager::setActive( bool active, const QString& nodeid, const QSharedPointer<ConnectionManager>& manager )
{
QMutexLocker locker( nodeMapMutex );
QMutexLocker locker( &nodeMapMutex );
if ( active )
{
activeConnectionManagers[ nodeid ] = manager;