From fc57b437c299545e976c12aa9ad4a190253644c5 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 31 Aug 2021 22:45:28 +0200 Subject: [PATCH] Fix radio items leak --- src/radios/radiomodel.cpp | 4 ++++ src/radios/radiomodel.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/radios/radiomodel.cpp b/src/radios/radiomodel.cpp index 74977f7af..eaceef5ae 100644 --- a/src/radios/radiomodel.cpp +++ b/src/radios/radiomodel.cpp @@ -60,6 +60,10 @@ RadioModel::RadioModel(Application *app, QObject *parent) } +RadioModel::~RadioModel() { + delete root_; +} + Qt::ItemFlags RadioModel::flags(const QModelIndex &idx) const { switch (IndexToItem(idx)->type) { diff --git a/src/radios/radiomodel.h b/src/radios/radiomodel.h index 023f9150b..b425544a4 100644 --- a/src/radios/radiomodel.h +++ b/src/radios/radiomodel.h @@ -48,6 +48,7 @@ class RadioModel : public SimpleTreeModel { public: explicit RadioModel(Application *app, QObject *parent = nullptr); + ~RadioModel() override; enum Role { Role_Type = Qt::UserRole + 1,