summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-08-21 10:48:35 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-08-21 11:37:35 (GMT)
commitd1ced31e867f7e2bbd56daf46c7bf3cc924c8546 (patch)
tree85f027834faacdb478533c9b2aa490d802283518 /tests/auto
parentf5f89d34fa98600a95c4b1b8b62bd794ab8c8e3b (diff)
downloadQt-d1ced31e867f7e2bbd56daf46c7bf3cc924c8546.zip
Qt-d1ced31e867f7e2bbd56daf46c7bf3cc924c8546.tar.gz
Qt-d1ced31e867f7e2bbd56daf46c7bf3cc924c8546.tar.bz2
Fix memory leak
When the variant is invalid the shared is not destroyed. We even can avoid the creation of the PrivateShared if we know the variant is invalid Reviewed-by: Thierry
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qvariant/tst_qvariant.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp
index 1722ad3..5ed0dcd 100644
--- a/tests/auto/qvariant/tst_qvariant.cpp
+++ b/tests/auto/qvariant/tst_qvariant.cpp
@@ -2622,7 +2622,7 @@ void tst_QVariant::qvariant_cast_QObject_data() {
QTest::addColumn<QVariant>("data");
QTest::addColumn<bool>("success");
- QTest::newRow("from QObject") << QVariant(QMetaType::QObjectStar, new QObject) << true;
+ QTest::newRow("from QObject") << QVariant(QMetaType::QObjectStar, new QObject(this)) << true;
QTest::newRow("from String") << QVariant(QLatin1String("1, 2, 3")) << false;
QTest::newRow("from int") << QVariant((int) 123) << false;
}