aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmldebug
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2016-07-25 10:59:59 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-07-25 09:04:02 +0000
commit8ce46d80e67aea81bf2782efb402c33d57607ffb (patch)
tree46a612152a3a8e99ced2f1d61cfee4e6e7e2d763 /src/libs/qmldebug
parent9c72b5bec2b7cce994fe3e367d682aa1d61e194e (diff)
QmlDebug: Avoid crash on socket disconnect
Change-Id: I873b2c84d32498ea4ea2591866d0dff13d59503b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/libs/qmldebug')
-rw-r--r--src/libs/qmldebug/qmldebugclient.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libs/qmldebug/qmldebugclient.cpp b/src/libs/qmldebug/qmldebugclient.cpp
index 052655309a..38c15ea868 100644
--- a/src/libs/qmldebug/qmldebugclient.cpp
+++ b/src/libs/qmldebug/qmldebugclient.cpp
@@ -141,8 +141,11 @@ void QmlDebugConnection::socketDisconnected()
} else if (d->device) {
emit connectionFailed();
}
- delete d->protocol;
- d->protocol = 0;
+ if (d->protocol) {
+ d->protocol->disconnect();
+ d->protocol->deleteLater();
+ d->protocol = 0;
+ }
if (d->device) {
// Don't allow any "connected()" or "disconnected()" signals to be triggered anymore.
// As the protocol is gone this would lead to crashes.