From 37d02d62d8d14fdaa0884f96f7840661413a95c2 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 21 Apr 2015 16:42:56 +0200 Subject: Make bindings refcounted Refcounting our bindings greatly simplifies our memory management of the objects and ensures we safely clean them all up. In addition, it allows us to remove the m_mePtr and weak reference handling from QQmlAbstractBinding as we can safely handle this through the same mechanism. Change-Id: If23ebc8be276096146952b0008b62018f5d57faf Reviewed-by: Simon Hausmann --- tests/auto/quick/qquickstates/tst_qquickstates.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/quick/qquickstates') diff --git a/tests/auto/quick/qquickstates/tst_qquickstates.cpp b/tests/auto/quick/qquickstates/tst_qquickstates.cpp index 6c42a7a0ee..4748cd2514 100644 --- a/tests/auto/quick/qquickstates/tst_qquickstates.cpp +++ b/tests/auto/quick/qquickstates/tst_qquickstates.cpp @@ -1637,7 +1637,7 @@ void tst_qquickstates::QTBUG_38492() void tst_qquickstates::revertListMemoryLeak() { - QWeakPointer weakPtr; + QQmlAbstractBinding::Ptr bindingPtr; { QQmlEngine engine; @@ -1651,12 +1651,12 @@ void tst_qquickstates::revertListMemoryLeak() QQmlAbstractBinding *binding = state->bindingInRevertList(item, "height"); QVERIFY(binding); - weakPtr = QQmlAbstractBinding::getPointer(binding); - QVERIFY(!weakPtr.toStrongRef().isNull()); + bindingPtr = binding; + QVERIFY(bindingPtr->ref > 1); delete item; } - QVERIFY(weakPtr.toStrongRef().isNull()); + QVERIFY(bindingPtr->ref == 1); } QTEST_MAIN(tst_qquickstates) -- cgit v1.2.3