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 ...@@ -260,7 +260,7 @@ void APMParameterMetaData::loadParameterFactMetaDataFile(const QString& metaData
qCDebug(APMParameterMetaDataLog) << "Duplicate parameter found:" << name; qCDebug(APMParameterMetaDataLog) << "Duplicate parameter found:" << name;
rawMetaData = _vehicleTypeToParametersMap[currentCategory][name]; rawMetaData = _vehicleTypeToParametersMap[currentCategory][name];
} else { } else {
rawMetaData = new APMFactMetaDataRaw(); rawMetaData = new APMFactMetaDataRaw(this);
_vehicleTypeToParametersMap[currentCategory][name] = rawMetaData; _vehicleTypeToParametersMap[currentCategory][name] = rawMetaData;
groupMembers[group] << name; groupMembers[group] << name;
} }
......
...@@ -24,11 +24,12 @@ ...@@ -24,11 +24,12 @@
Q_DECLARE_LOGGING_CATEGORY(APMParameterMetaDataLog) Q_DECLARE_LOGGING_CATEGORY(APMParameterMetaDataLog)
Q_DECLARE_LOGGING_CATEGORY(APMParameterMetaDataVerboseLog) Q_DECLARE_LOGGING_CATEGORY(APMParameterMetaDataVerboseLog)
class APMFactMetaDataRaw class APMFactMetaDataRaw : public QObject
{ {
Q_OBJECT
public: public:
APMFactMetaDataRaw(void) APMFactMetaDataRaw(QObject *parent = nullptr)
: rebootRequired(false) : QObject(parent), rebootRequired(false)
{ } { }
QString name; QString name;
......
...@@ -213,9 +213,7 @@ void PX4ParameterMetaData::loadParameterFactMetaDataFile(const QString& metaData ...@@ -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 // Now that we know type we can create meta data object and add it to the system
metaData = new FactMetaData(foundType, this);
metaData = new FactMetaData(foundType);
Q_CHECK_PTR(metaData);
if (_mapParameterName2FactMetaData.contains(name)) { if (_mapParameterName2FactMetaData.contains(name)) {
// We can't trust the meta data since we have dups // We can't trust the meta data since we have dups
qCWarning(PX4ParameterMetaDataLog) << "Duplicate parameter found:" << name; 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