From 7ec1dba0953593ffdf97b0a93fb6442d3cd085df Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 30 Sep 2019 16:55:59 +0200 Subject: 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 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmltype.cpp | 2 ++ 1 file changed, 2 insertions(+) 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; -- cgit v1.2.3