aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-04-27 16:09:22 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-01 06:04:47 +0200
commite39908c658c6caa2013bc7356eb904b669af1bfb (patch)
tree34c2cf6f42ce9d8f0ce43f940e5da0dc8f52879e /tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
parent78f1d2679242c84efe6d8eb763c13caf58efe19d (diff)
Ensure context is valid before VME method creation
Ensure that a valid context exists prior to evaluation of a VME method function. Invalid contexts can occur if a method's first invocation is triggered after the destruction of the component's context. Task-number: QTBUG-25516 Change-Id: I349a73c5713e178f920c44f5ddcaa1dc6eec199f Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp')
-rw-r--r--tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
index 16365eeaa8..55f93c62c9 100644
--- a/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
+++ b/tests/auto/qml/qqmlcontext/tst_qqmlcontext.cpp
@@ -71,6 +71,8 @@ private slots:
void refreshExpressionsRootContext();
void qtbug_22535();
+ void evalAfterInvalidate();
+
private:
QQmlEngine engine;
};
@@ -647,6 +649,16 @@ void tst_qqmlcontext::qtbug_22535()
delete o;
}
+void tst_qqmlcontext::evalAfterInvalidate()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("evalAfterInvalidate.qml"));
+ QScopedPointer<QObject> o(component.create());
+
+ QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::processEvents();
+}
+
QTEST_MAIN(tst_qqmlcontext)
#include "tst_qqmlcontext.moc"