Skip to content

Commit

Permalink
Add some more explicit destructors for shared obj typeinfo critical c…
Browse files Browse the repository at this point in the history
…lasses

refs #13563
  • Loading branch information
mspieth committed Jan 30, 2020
1 parent f011f2a commit c894ef6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
26 changes: 26 additions & 0 deletions mythtv/libs/libmythmetadata/metadatafactory.cpp
Expand Up @@ -39,15 +39,41 @@ using std::max;
QEvent::Type MetadataFactoryNoResult::kEventType =
(QEvent::Type) QEvent::registerEventType();

MetadataFactoryNoResult::~MetadataFactoryNoResult()
{
if (m_result)
{
m_result->DecrRef();
m_result = nullptr;
}
}

QEvent::Type MetadataFactorySingleResult::kEventType =
(QEvent::Type) QEvent::registerEventType();

MetadataFactorySingleResult::~MetadataFactorySingleResult()
{
if (m_result)
{
m_result->DecrRef();
m_result = nullptr;
}
}

QEvent::Type MetadataFactoryMultiResult::kEventType =
(QEvent::Type) QEvent::registerEventType();

MetadataFactoryMultiResult::~MetadataFactoryMultiResult()
{
}

QEvent::Type MetadataFactoryVideoChanges::kEventType =
(QEvent::Type) QEvent::registerEventType();

MetadataFactoryVideoChanges::~MetadataFactoryVideoChanges()
{
}

MetadataFactory::MetadataFactory(QObject *parent) :
QObject(parent)
{
Expand Down
22 changes: 4 additions & 18 deletions mythtv/libs/libmythmetadata/metadatafactory.h
Expand Up @@ -22,7 +22,7 @@ class META_PUBLIC MetadataFactoryMultiResult : public QEvent
public:
explicit MetadataFactoryMultiResult(const MetadataLookupList& res)
: QEvent(kEventType), m_results(res) {}
~MetadataFactoryMultiResult() override = default;
~MetadataFactoryMultiResult() override;

MetadataLookupList m_results;

Expand All @@ -40,14 +40,7 @@ class META_PUBLIC MetadataFactorySingleResult : public QEvent
m_result->IncrRef();
}
}
~MetadataFactorySingleResult() override
{
if (m_result)
{
m_result->DecrRef();
m_result = nullptr;
}
}
~MetadataFactorySingleResult() override;

MetadataLookup *m_result {nullptr};

Expand All @@ -65,14 +58,7 @@ class META_PUBLIC MetadataFactoryNoResult : public QEvent
m_result->IncrRef();
}
}
~MetadataFactoryNoResult() override
{
if (m_result)
{
m_result->DecrRef();
m_result = nullptr;
}
}
~MetadataFactoryNoResult() override;

MetadataLookup *m_result {nullptr};

Expand All @@ -87,7 +73,7 @@ class META_PUBLIC MetadataFactoryVideoChanges : public QEvent
m_additions(std::move(adds)),
m_moved(std::move(movs)),
m_deleted(std::move(dels)) {}
~MetadataFactoryVideoChanges() override = default;
~MetadataFactoryVideoChanges() override;

QList<int> m_additions; // newly added intids
QList<int> m_moved; // intids moved to new filename
Expand Down

0 comments on commit c894ef6

Please sign in to comment.