Revert "QDbus: Avoid memory leak in registerComplexDBusType"

This reverts commit 4c1df115ecfb14c353c0ec46efdb1f9d2fc0ea95.

We cannot guarantee that there are no more QMetaType
instances that reference the interfaces being destroyed.
All such instances will become invalid after the interface
destruction with no way to verify that.

Change-Id: Iad17fe88753143734b8b817dda184e3c3818575c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8a3330be38b5cac6098795f502fd54e7c8f555fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ievgenii Meshcheriakov 2023-08-11 11:50:45 +02:00 committed by Qt Cherry-pick Bot
parent 7ae5b002dc
commit 89552df61d

View File

@ -116,11 +116,8 @@ static int registerComplexDBusType(const QByteArray &typeName)
{
~Hash()
{
for (QMetaType entry : std::as_const(*this)) {
auto iface = static_cast<const QDBusRawTypeHandler *>(entry.iface());
for (QMetaType entry : *this)
QMetaType::unregisterMetaType(std::move(entry));
delete iface;
}
}
} hash;
QMutexLocker lock(&mutex);