diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp index 3a1343f6f1a..a81b092a1db 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp @@ -120,8 +120,15 @@ void QmlProfilerClientManager::discardPendingData() void QmlProfilerClientManager::connectClient(quint16 port) { - if (d->connection) - delete d->connection; + if (d->connection) { + if (port == d->tcpPort) { + tryToConnect(); + return; + } else { + delete d->connection; + } + } + d->connection = new QmlDebugConnection; enableServices(); connect(d->connection, SIGNAL(stateMessage(QString)), this, SLOT(logState(QString)));