From cb32ffff855e2cc2ed14e20a59b396a65470e391 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 19 Aug 2015 10:40:05 +0200 Subject: [PATCH] QmlDebug: Check if packet protocol is still alive after flush() An QAbstractSocket can disconnect itself on flush(), which we call after sending any packets. This leads to the packet protocol getting deleted and in the next iteration of the loop QmlDebugConnectionPrivate::readyRead() we'd use a null pointer. Prevent that by checking for null. Change-Id: Idfdb68a10c3e4deee7b305ff3b028247809090a6 Reviewed-by: hjk --- src/libs/qmldebug/qmldebugclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/qmldebug/qmldebugclient.cpp b/src/libs/qmldebug/qmldebugclient.cpp index d0f4782eb2..2f5b7976cd 100644 --- a/src/libs/qmldebug/qmldebugclient.cpp +++ b/src/libs/qmldebug/qmldebugclient.cpp @@ -191,7 +191,7 @@ void QmlDebugConnectionPrivate::readyRead() emit q->opened(); } - while (protocol->packetsAvailable()) { + while (protocol && protocol->packetsAvailable()) { QPacket pack = protocol->read(); QString name; pack >> name; -- GitLab