summaryrefslogtreecommitdiffstats
path: root/tests/auto/core
diff options
context:
space:
mode:
authorJim Albamont <jim.albamont@kdab.com>2019-09-11 09:52:05 -0700
committerJim Albamont <jim.albamont@kdab.com>2019-09-13 08:36:21 -0700
commitc89997143cd6e51916924b71c8b0bf8705480a67 (patch)
tree2d416eba5087c7ba5fbe1371960b47cc6924e57b /tests/auto/core
parent7814da64942c4566e2fa9c9e2bd2a1e169e7fab9 (diff)
Fix crash in tst_QShaderProgram
We install the TestArbiter on "this" in one test and the TestArbiter is destroyed at the end of that test. In a second test we again install a TestArbiter on "this". The call to QNode::setArbiter tries to access the desroyed arbiter (m_changeArbiter->removeDirtyFrontEndNode(q)) resulting in a crash. Need to set a null arbiter on "this" to properly clean up. Also fix a few other incorrect uses that weren't crashing. Change-Id: Iee2ea8210df971f934e2f188748803c8745c8278 Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'tests/auto/core')
-rw-r--r--tests/auto/core/qskeleton/tst_qskeleton.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/core/qskeleton/tst_qskeleton.cpp b/tests/auto/core/qskeleton/tst_qskeleton.cpp
index 6ad6e538c..04c9bf7a1 100644
--- a/tests/auto/core/qskeleton/tst_qskeleton.cpp
+++ b/tests/auto/core/qskeleton/tst_qskeleton.cpp
@@ -193,6 +193,9 @@ private Q_SLOTS:
QCOMPARE(spy.count(), 0);
QCOMPARE(arbiter.events.size(), 0);
QCOMPARE(jointCount(), newJointCount);
+
+ // Cleanup
+ QNodePrivate::get(this)->setArbiter(nullptr);
}
};