QmlProfiler: Properly clear any pending connections before reconnecting

Otherwise we might end up waiting forever for a previous session's
connection.

Change-Id: I695d7a1ce21bc9720cc84436a7c4e6ba4616b0ab
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-04-15 12:14:00 +02:00
parent 12788ffb2d
commit f0b7a73f33

View File

@@ -112,13 +112,18 @@ void QmlProfilerClientManager::setTcpConnection(QString host, quint64 port)
{
d->tcpHost = host;
d->tcpPort = port;
d->localSocket.clear();
disconnectClient();
// Wait for the application to announce the port before connecting.
}
void QmlProfilerClientManager::setLocalSocket(QString file)
{
d->localSocket = file;
d->tcpHost.clear();
d->tcpPort = 0;
disconnectClient();
// We open the server and the application connects to it, so let's do that right away.
connectLocalClient(file);
}