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.

Pick-to: 6.6 6.5
Change-Id: Iad17fe88753143734b8b817dda184e3c3818575c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Ievgenii Meshcheriakov 2023-08-11 11:50:45 +02:00
parent df485fff26
commit 8a3330be38

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);