mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
Only destroy existing ControlConnection if it does not run anymore
This commit is contained in:
@@ -789,9 +789,16 @@ Servent::connectToPeer( const peerinfo_ptr& peerInfo )
|
|||||||
peerInfoDebug( peerInfo ) << "connectToPeer: search for already established connections to the same nodeid:" << m_controlconnections.count() << "connections";
|
peerInfoDebug( peerInfo ) << "connectToPeer: search for already established connections to the same nodeid:" << m_controlconnections.count() << "connections";
|
||||||
if ( peerInfo->controlConnection() )
|
if ( peerInfo->controlConnection() )
|
||||||
{
|
{
|
||||||
peerInfoDebug( peerInfo ) << Q_FUNC_INFO << "deleting the existing Controlconnection";
|
if ( peerInfo->controlConnection()->isReady() && peerInfo->controlConnection()->isRunning() ) {
|
||||||
|
peerInfoDebug( peerInfo ) << Q_FUNC_INFO << "We have a running ControlConnection, so no use to connect.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
peerInfoDebug( peerInfo ) << Q_FUNC_INFO << "deleting the existing ControlConnection";
|
||||||
delete peerInfo->controlConnection();
|
delete peerInfo->controlConnection();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool isDupe = false;
|
bool isDupe = false;
|
||||||
ControlConnection* conn = 0;
|
ControlConnection* conn = 0;
|
||||||
|
Reference in New Issue
Block a user