diff options
author | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2013-03-20 19:23:54 +0100 |
---|---|---|
committer | Fawzi Mohamed <fawzi.mohamed@digia.com> | 2013-03-20 22:24:20 +0100 |
commit | fba08f2552454f40bb5bb4c3a9edd88be381c9af (patch) | |
tree | 4758758634cd7c33cc27e3b25275fb1ca994f6e5 | |
parent | 7b1942083719cb7c9898aaa151ced58913f15a54 (diff) |
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: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r-- | src/libs/utils/consoleprocess_unix.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libs/utils/consoleprocess_unix.cpp b/src/libs/utils/consoleprocess_unix.cpp index c6307d002f..e6a2521720 100644 --- a/src/libs/utils/consoleprocess_unix.cpp +++ b/src/libs/utils/consoleprocess_unix.cpp @@ -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(); |