Commit 134e41ee authored by Thomas Hartmann's avatar Thomas Hartmann

QmlDesigner.nodeInstances: crash fix

In some cases object() != m_nodeInstance->object().
Reading on the worng type of QObject can lead to very interesting
effects.  (e. g. decrementing the pointer to the vtable)

Task-Nr: QTCREATORBUG-4675
Reviewed-by: Marco Bubke
parent 0515e73e
......@@ -92,7 +92,7 @@ int NodeInstanceMetaObject::metaCall(QMetaObject::Call call, int id, void **a)
if (call == QMetaObject::WriteProperty && !property(id).hasNotifySignal())
{
oldValue = property(id).read(m_nodeInstance->object());
oldValue = property(id).read(object());
}
ObjectNodeInstance::Pointer objectNodeInstance = m_nodeInstance.toStrongRef();
......@@ -119,7 +119,7 @@ int NodeInstanceMetaObject::metaCall(QMetaObject::Call call, int id, void **a)
if (metaCallReturnValue >= 0
&& call == QMetaObject::WriteProperty
&& !property(id).hasNotifySignal()
&& oldValue != property(id).read(m_nodeInstance->object()))
&& oldValue != property(id).read(object()))
notifyPropertyChange(id);
return metaCallReturnValue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment