Valgrind: Make socket parentless when passed to Parser

Otherwise, when the socket is a child of QTcpServer,
it may be deleted together with a server, while it's
still held in Parser instance.

Change-Id: I600e9cef1268ffc93e1e86d317e087df8b4d70cb
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-08-16 17:40:24 +02:00
parent 45246834cc
commit b32333343b

View File

@@ -761,6 +761,7 @@ void Parser::setSocket(QAbstractSocket *socket)
QTC_ASSERT(socket, return);
QTC_ASSERT(socket->isOpen(), return);
QTC_ASSERT(!isRunning(), return);
socket->setParent(nullptr); // Don't delete it together with parent QTcpServer anymore.
d->m_socket.reset(socket);
}