mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
No need for a pointer here
This commit is contained in:
@@ -32,14 +32,14 @@
|
|||||||
|
|
||||||
/* Management of ConnectionManagers */
|
/* Management of ConnectionManagers */
|
||||||
|
|
||||||
static QMutex* nodeMapMutex = new QMutex();
|
static QMutex nodeMapMutex;
|
||||||
static QMap< QString, QWeakPointer< ConnectionManager > > connectionManagers;
|
static QMap< QString, QWeakPointer< ConnectionManager > > connectionManagers;
|
||||||
static QMap< QString, QSharedPointer< ConnectionManager > > activeConnectionManagers;
|
static QMap< QString, QSharedPointer< ConnectionManager > > activeConnectionManagers;
|
||||||
|
|
||||||
QSharedPointer<ConnectionManager>
|
QSharedPointer<ConnectionManager>
|
||||||
ConnectionManager::getManagerForNodeId( const QString &nodeid )
|
ConnectionManager::getManagerForNodeId( const QString &nodeid )
|
||||||
{
|
{
|
||||||
QMutexLocker locker( nodeMapMutex );
|
QMutexLocker locker( &nodeMapMutex );
|
||||||
if ( connectionManagers.contains( nodeid ) && !connectionManagers.value( nodeid ).isNull() ) {
|
if ( connectionManagers.contains( nodeid ) && !connectionManagers.value( nodeid ).isNull() ) {
|
||||||
return connectionManagers.value( nodeid ).toStrongRef();
|
return connectionManagers.value( nodeid ).toStrongRef();
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ ConnectionManager::getManagerForNodeId( const QString &nodeid )
|
|||||||
void
|
void
|
||||||
ConnectionManager::setActive( bool active, const QString& nodeid, const QSharedPointer<ConnectionManager>& manager )
|
ConnectionManager::setActive( bool active, const QString& nodeid, const QSharedPointer<ConnectionManager>& manager )
|
||||||
{
|
{
|
||||||
QMutexLocker locker( nodeMapMutex );
|
QMutexLocker locker( &nodeMapMutex );
|
||||||
if ( active )
|
if ( active )
|
||||||
{
|
{
|
||||||
activeConnectionManagers[ nodeid ] = manager;
|
activeConnectionManagers[ nodeid ] = manager;
|
||||||
|
Reference in New Issue
Block a user