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>
This commit is contained in:
parent
2c750b4570
commit
bb7d26ebb0
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue