Avoid running into Qt assertion when destructing TagFieldEdit

This commit is contained in:
Martchus 2023-08-08 22:47:53 +02:00
parent 488684a318
commit 1e45722ea1
2 changed files with 9 additions and 0 deletions

View File

@ -81,6 +81,14 @@ TagFieldEdit::TagFieldEdit(const QList<TagParser::Tag *> &tags, TagParser::Known
updateValue();
}
TagFieldEdit::~TagFieldEdit()
{
// delete those actions before entering base class destructors as we connect signal handlers when those actions are
// destructed and calling those handlers is gonna break otherwise
delete m_lockAction;
delete m_restoreAction;
}
/*!
* \brief Assigns the specified \a tags and sets the specified \a fields using the given \a previousValueHandling.
*

View File

@ -39,6 +39,7 @@ class TagFieldEdit : public QWidget {
public:
explicit TagFieldEdit(const QList<TagParser::Tag *> &tags, TagParser::KnownField field, QWidget *parent = nullptr);
~TagFieldEdit() override;
const QList<TagParser::Tag *> &tags() const;
TagParser::KnownField field() const;