Skip to content
Snippets Groups Projects
Commit cb32ffff authored by Ulf Hermann's avatar Ulf Hermann
Browse files

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: default avatarhjk <hjk@theqtcompany.com>
parent f1b9f56c
No related branches found
No related tags found
No related merge requests found
...@@ -191,7 +191,7 @@ void QmlDebugConnectionPrivate::readyRead() ...@@ -191,7 +191,7 @@ void QmlDebugConnectionPrivate::readyRead()
emit q->opened(); emit q->opened();
} }
while (protocol->packetsAvailable()) { while (protocol && protocol->packetsAvailable()) {
QPacket pack = protocol->read(); QPacket pack = protocol->read();
QString name; QString name;
pack >> name; pack >> name;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment