From 394fddbe1ed93f8aafc29ace8217ad8d77e7276f Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 22 Sep 2009 14:50:48 +0200 Subject: Fix memleak in tst_qhttpnetworkconnection Reviewed-by: TrustMe --- src/corelib/io/qnoncontiguousbytedevice_p.h | 4 +++- tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qnoncontiguousbytedevice_p.h b/src/corelib/io/qnoncontiguousbytedevice_p.h index e55a46c..34d6980 100644 --- a/src/corelib/io/qnoncontiguousbytedevice_p.h +++ b/src/corelib/io/qnoncontiguousbytedevice_p.h @@ -72,9 +72,11 @@ public: void disableReset(); virtual qint64 size() = 0; + virtual ~QNonContiguousByteDevice(); + protected: QNonContiguousByteDevice(); - virtual ~QNonContiguousByteDevice(); + bool resetDisabled; Q_SIGNALS: diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp index e1e25d2..470e57f 100644 --- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp +++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp @@ -320,6 +320,7 @@ void tst_QHttpNetworkConnection::put() QByteArray array = data.toLatin1(); QNonContiguousByteDevice *bd = QNonContiguousByteDeviceFactory::create(&array); + bd->setParent(this); request.setUploadByteDevice(bd); finishedCalled = false; @@ -411,6 +412,7 @@ void tst_QHttpNetworkConnection::post() QByteArray array = data.toLatin1(); QNonContiguousByteDevice *bd = QNonContiguousByteDeviceFactory::create(&array); + bd->setParent(this); request.setUploadByteDevice(bd); QHttpNetworkReply *reply = connection.sendRequest(request); -- cgit v0.12