forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user