Fix bug in designer support reference counting
The QtQuick designer support may override the meta-object and reparent the property-cache of the object under editing. The code for replacing the parent of the property cache however was not handling the refcount of the _parent correctly. Change-Id: Ic73294fc208b297e8ec9c0b775b5da01a309dba6 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
This commit is contained in:
parent
7cd4d60c74
commit
7dc5cd942e
|
@ -452,7 +452,12 @@ QQmlPropertyCache *QQmlPropertyCache::parent() const
|
|||
|
||||
void QQmlPropertyCache::setParent(QQmlPropertyCache *newParent)
|
||||
{
|
||||
if (_parent == newParent)
|
||||
return;
|
||||
if (_parent)
|
||||
_parent->release();
|
||||
_parent = newParent;
|
||||
_parent->addref();
|
||||
}
|
||||
|
||||
// Returns the first C++ type's QMetaObject - that is, the first QMetaObject not created by
|
||||
|
|
Loading…
Reference in New Issue