Commit ccb6d613 authored by Ulf Hermann's avatar Ulf Hermann
Browse files

QmlProfiler: Don't needlessly delete debug connections



If we're already trying to connect when the "Waiting for ..." message
arrives we don't want to start from scratch, but rather reuse the
existing connection.

Otherwise the handshake may be interrupted in an arbitrary state,
either leaving the remote QML engine waiting for the local QML profiler
to send the recording status, or prompting the local profiler client to
stop recording as the connection "broke".

The local QML profiler will only send the recording status if new QML
engines show up, which doesn't happen on the second successful
connection. That may be a different bug.

Change-Id: Ia17fcf9d0a28edf700274bcd88c2b7030220c290
Reviewed-by: default avatarRobert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 9ca46480
......@@ -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)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment