aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-09-30 16:55:59 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-10-08 09:29:54 +0200
commit7ec1dba0953593ffdf97b0a93fb6442d3cd085df (patch)
tree15890707af752076d12ae6bbb95390c236847314
parente80ef5934e71bcc52bdcabb6d3fe1d1b100d75c4 (diff)
Free dynamic metaobjects when destroying QQmlTypePrivate
The metaobjects are created by QMetaObjectBuilder and the documentation of toMetaObject() states that we should free() the memory when we're done with it. Change-Id: Ie75d284982bf7cd23b7e389b44443ee6d3b3501e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/qml/qml/qqmltype.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/qml/qqmltype.cpp b/src/qml/qml/qqmltype.cpp
index 2db3ad6b2a..874bcd4bca 100644
--- a/src/qml/qml/qqmltype.cpp
+++ b/src/qml/qml/qqmltype.cpp
@@ -91,6 +91,8 @@ QQmlTypePrivate::QQmlTypePrivate(QQmlType::RegistrationType type)
QQmlTypePrivate::~QQmlTypePrivate()
{
qDeleteAll(scopedEnums);
+ for (const auto &metaObject : metaObjects)
+ free(metaObject.metaObject);
switch (regType) {
case QQmlType::CppType:
delete extraData.cd->customParser;