mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
No need for a pointer here
This commit is contained in:
parent
2cbfcc7952
commit
9e24fc7ddc
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user