Commit fba08f25 authored by Fawzi Mohamed's avatar Fawzi Mohamed
Browse files

consoleprocess_unix: handle race between disconnect and readyRead



Ensure that we read before zeroing the pointer to the stubSocket
and not after.

Change-Id: If9d6f11916e644be96ed88db6a2595509f177233
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@digia.com>
parent 7b194208
......@@ -246,8 +246,11 @@ QString ConsoleProcess::stubServerListen()
void ConsoleProcess::stubServerShutdown()
{
if (d->m_stubSocket)
if (d->m_stubSocket) {
readStubOutput(); // we could get the shutdown signal before emptying the buffer
d->m_stubSocket->disconnect(); // avoid getting queued readyRead signals
d->m_stubSocket->deleteLater(); // we might be called from the disconnected signal of m_stubSocket
}
d->m_stubSocket = 0;
if (d->m_stubServer.isListening()) {
d->m_stubServer.close();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment