tst_QSharedPointer: fix memleak

Benign, but easy to avoid by using automatic storage.

Change-Id: I4eefce9a7c902ceadebdd0aba1bbba7e5519cf24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Marc Mutz 2014-10-16 12:20:09 +02:00
parent d78bbf8c81
commit 4cf9168630

View File

@ -2112,7 +2112,8 @@ void tst_QSharedPointer::qvariantCast()
// Intentionally does not compile.
// QWeakPointer<int> sop = qWeakPointerFromVariant<int>(v);
QWeakPointer<QFile> tracking = new QFile;
QFile file;
QWeakPointer<QFile> tracking = &file;
tracking.data()->setObjectName("A test name");
v = QVariant::fromValue(tracking);