aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmltc/qmltccompilerpieces.h
diff options
context:
space:
mode:
authorAndrei Golubev <andrei.golubev@qt.io>2022-06-10 15:06:35 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-15 19:53:25 +0000
commit9ac74fdf441b5d07199ab7d2f31bf1c9f363856e (patch)
treedbfac36658f8a855dd98c2bf0d7ea53273022936 /tools/qmltc/qmltccompilerpieces.h
parent6ca03c693f025f5c4dadeef8468c758e8fa067ab (diff)
Fix QQmlTypePrivate memory leak in qmltc-generated types with extensions
Apparently registering the QQmlTypePrivate for a meta-object is not good enough. Somehow clang's ASan failed to discover a memory leak but gcc's ASan did not. After carefully exercising the code and a bit of debugging, turns out we indeed not release manually created QQmlTypePrivate objects. Do release the QQmlTypePrivate correctly now In the process of doing so, remove now-redundant QMetaObject function parameter Amends 26179e693717535eeff2e7b2a6ee99dc02dcd8f9 Change-Id: Ia0c808cd8a09cf996672bca9953108facfdf5d4e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 48ae7468afc06d52844badb3f5f41114f67a360f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tools/qmltc/qmltccompilerpieces.h')
-rw-r--r--tools/qmltc/qmltccompilerpieces.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/qmltc/qmltccompilerpieces.h b/tools/qmltc/qmltccompilerpieces.h
index bc423807fb..9afc001b55 100644
--- a/tools/qmltc/qmltccompilerpieces.h
+++ b/tools/qmltc/qmltccompilerpieces.h
@@ -236,10 +236,7 @@ inline decltype(auto) QmltcCodeGenerator::generate_initCode(QmltcType &current,
if (hasExtension) {
current.init.body << u"{"_s;
current.init.body << u"auto cppData = QmltcTypeData(this);"_s;
- current.init.body
- << QStringLiteral(
- "qmltcCreateDynamicMetaObject(this, &%1::staticMetaObject, cppData);")
- .arg(type->internalName());
+ current.init.body << u"qmltcCreateDynamicMetaObject(this, cppData);"_s;
current.init.body << u"}"_s;
}