Debugger: Fix Segmentation Fault on Windows

This amends 035b8aa5f7. shutdown() is
called from GdbEngine and from OutputColloector's Dtor. Thus there is a
change we access m_socket, after it is nullified.

Change-Id: I7d26ded70d0b148d83eb551edaf9b82850db197e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Björn Schäpers
2022-02-14 21:25:12 +01:00
committed by Björn Schäpers
parent 1652be1310
commit 48ce753a05

View File

@@ -156,7 +156,8 @@ void OutputCollector::newConnectionAvailable()
void OutputCollector::bytesAvailable()
{
#ifdef Q_OS_WIN
emit byteDelivery(m_socket->readAll());
if (m_socket)
emit byteDelivery(m_socket->readAll());
#else
size_t nbytes = 0;
if (::ioctl(m_serverFd, FIONREAD, (char *) &nbytes) < 0)