diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-20 15:56:26 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-11-26 10:36:55 +0000 |
commit | e3c16259ed5297a3ee707d0aeade985ae103992e (patch) | |
tree | 27031107283808c68d9cba1c8ae3471bf2c39d9f /src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp | |
parent | f710ec8ce2f37a20db77aa40da1121b7a504254a (diff) |
QmlProfiler: When showing connection error, cancel any connects
The device can exist without being open, which makes the disconnect()
when the message box finishes ineffective. Also, disconnect() merely
trashes the signals and slots, but doesn't remove the device.
Task-number: QTCREATORBUG-15383
Change-Id: I8eb8ca3db496c9841156c0949c3e3bfd92329056
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp index 04f2ac0eb6..a355955f5b 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp @@ -245,6 +245,8 @@ void QmlProfilerClientManager::tryToConnect() } else if (d->connectionAttempts == 50) { d->connectionTimer.stop(); d->connectionAttempts = 0; + delete d->connection; // delete directly. + d->connection = 0; QMessageBox *infoBox = QmlProfilerTool::requestMessageBox(); infoBox->setIcon(QMessageBox::Critical); @@ -300,14 +302,11 @@ void QmlProfilerClientManager::logState(const QString &msg) void QmlProfilerClientManager::retryMessageBoxFinished(int result) { - if (d->connection) { - QTC_ASSERT(!d->connection->isOpen(), return); - if (d->connection->isConnecting()) - d->connection->disconnect(); - } + QTC_ASSERT(!d->connection, disconnectClient()); switch (result) { case QMessageBox::Retry: { + connectClient(d->tcpPort); d->connectionAttempts = 0; d->connectionTimer.start(); break; |