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:
parent
d78bbf8c81
commit
4cf9168630
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user