aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-10-31 09:32:06 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-31 10:50:31 +0100
commitbb7d26ebb0c2e7a9f06a030be8bfcd00e346e06f (patch)
tree73854394b89be6bef1d25af78772281e67ddfaba /src/qml/qml
parent2c750b45709fa164b758c5ec9e0e9ee744c51555 (diff)
Fix crash in QObject tree destruction
This issue was discovered while running the QtQuick Controls auto-tests in valgrind. The issue is that the QObject based property in the VME meta object is deleted as a child, after its parent (that had the property) was deleted. At that point it's not safe anymore to emit the notify signal in the already-deleted object (m_target->object). Change-Id: I54e81dfedb6e712b8cbf182a72254e33e82910e3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmlvmemetaobject.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index 44b3b7d276..1547b2a89d 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -82,7 +82,8 @@ void QQmlVMEVariantQObjectPtr::objectDestroyed(QObject *)
}
}
- m_target->activate(m_target->object, m_target->methodOffset() + m_index, 0);
+ if (!QQmlData::wasDeleted(m_target->object))
+ m_target->activate(m_target->object, m_target->methodOffset() + m_index, 0);
}
}