Unverified Commit 4d9e9f68 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8473 from alexeylysenko/fix_memory_leak_firmware_plugin

Added parent to the new FactMetaData objects to be owned by parent
parents 6423d117 98c5057c
......@@ -260,7 +260,7 @@ void APMParameterMetaData::loadParameterFactMetaDataFile(const QString& metaData
qCDebug(APMParameterMetaDataLog) << "Duplicate parameter found:" << name;
rawMetaData = _vehicleTypeToParametersMap[currentCategory][name];
} else {
rawMetaData = new APMFactMetaDataRaw();
rawMetaData = new APMFactMetaDataRaw(this);
_vehicleTypeToParametersMap[currentCategory][name] = rawMetaData;
groupMembers[group] << name;
}
......
......@@ -24,11 +24,12 @@
Q_DECLARE_LOGGING_CATEGORY(APMParameterMetaDataLog)
Q_DECLARE_LOGGING_CATEGORY(APMParameterMetaDataVerboseLog)
class APMFactMetaDataRaw
class APMFactMetaDataRaw : public QObject
{
Q_OBJECT
public:
APMFactMetaDataRaw(void)
: rebootRequired(false)
APMFactMetaDataRaw(QObject *parent = nullptr)
: QObject(parent), rebootRequired(false)
{ }
QString name;
......
......@@ -213,9 +213,7 @@ void PX4ParameterMetaData::loadParameterFactMetaDataFile(const QString& metaData
}
// Now that we know type we can create meta data object and add it to the system
metaData = new FactMetaData(foundType);
Q_CHECK_PTR(metaData);
metaData = new FactMetaData(foundType, this);
if (_mapParameterName2FactMetaData.contains(name)) {
// We can't trust the meta data since we have dups
qCWarning(PX4ParameterMetaDataLog) << "Duplicate parameter found:" << name;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment