Skip to content

Commit

Permalink
Fix memory leak with value types
Browse files Browse the repository at this point in the history
Commit 3b14e2f replaced the
QQmlRefPointer<QQmlPropertyCache> with a raw QQmlPropertyCache pointer
and added a V4_NEEDS_DESTROY tag. However unfortunately the destroy()
method in the heap class does not decrease the reference count.

Change-Id: I90a8c56cd638592b67aae7041fbb57c879c4146c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
  • Loading branch information
tronical committed Feb 2, 2018
1 parent 8c05018 commit f7ffed9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/qml/qml/qqmlvaluetypewrapper.cpp
Expand Up @@ -96,6 +96,8 @@ void Heap::QQmlValueTypeWrapper::destroy()
valueType->metaType.destruct(gadgetPtr);
::operator delete(gadgetPtr);
}
if (_propertyCache)
_propertyCache->release();
Object::destroy();
}

Expand Down

0 comments on commit f7ffed9

Please sign in to comment.