diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-07-14 14:35:46 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-07-15 15:06:58 +0200 |
commit | 8cb542c2d430ffc5a6d63c404c7e700132e6364a (patch) | |
tree | c82df4a74678f6b5fe749f0889de4b803cef71b6 | |
parent | 9f8449a054a165ae560c91d3e31409bc293df80d (diff) |
tst_QTcpSocket: fix mem-leak
earlyConstructedSockets is a QObject, but had no parent and was never
deleted, leaking all the data is holds.
Fix by giving it a parent.
The code predates the begin of the public history.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ibc5688afd6111e84f591c37e39b6bb618d76c47a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index c16717e95a..4e08b5a30f 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -281,7 +281,7 @@ tst_QTcpSocket::tst_QTcpSocket() tmpSocket = 0; //This code relates to the socketsConstructedBeforeEventLoop test case - earlyConstructedSockets = new SocketPair; + earlyConstructedSockets = new SocketPair(this); QVERIFY(earlyConstructedSockets->create()); earlyBytesWrittenCount = 0; earlyReadyReadCount = 0; |