void QDeclarativeContextData::invalidate()
{
- while (childContexts) {
- if (childContexts->ownedByParent) {
- childContexts->destroy();
- } else {
- childContexts->invalidate();
- }
- }
-
while (componentAttached) {
QDeclarativeComponentAttached *a = componentAttached;
componentAttached = a->next;
emit a->destruction();
}
+ while (childContexts) {
+ if (childContexts->ownedByParent) {
+ childContexts->destroy();
+ } else {
+ childContexts->invalidate();
+ }
+ }
+
if (prevChild) {
*prevChild = nextChild;
if (nextChild) nextChild->prevChild = prevChild;
void refreshExpressionsCrash();
void refreshExpressionsRootContext();
+ void qtbug_22535();
private:
QDeclarativeEngine engine;
};
delete o1;
}
+void tst_qdeclarativecontext::qtbug_22535()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeComponent component(&engine, TEST_FILE("qtbug_22535.qml"));
+ QDeclarativeContext context(engine.rootContext());
+
+ QObject *o = component.create(&context);
+
+ // Don't crash!
+ delete o;
+}
+
QTEST_MAIN(tst_qdeclarativecontext)
#include "tst_qdeclarativecontext.moc"