forked from osmocom/wireshark
Fix memory leaks in Expert Info dialog
Models and children weren't deleted which leaked memory all over the place. Change-Id: I961016b2501ad8cc8c75cf5fa5b0c86756a29382 Reviewed-on: https://code.wireshark.org/review/24858 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
68668b785c
commit
0b88544b07
|
@ -127,6 +127,8 @@ ExpertInfoDialog::ExpertInfoDialog(QWidget &parent, CaptureFile &capture_file) :
|
|||
ExpertInfoDialog::~ExpertInfoDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete proxyModel_;
|
||||
delete expert_info_model_;
|
||||
}
|
||||
|
||||
void ExpertInfoDialog::clearAllData()
|
||||
|
|
|
@ -29,6 +29,12 @@ ExpertPacketItem::ExpertPacketItem(expert_info_t& expert_info, column_info *cinf
|
|||
|
||||
ExpertPacketItem::~ExpertPacketItem()
|
||||
{
|
||||
for (int row = 0; row < childItems_.count(); row++)
|
||||
{
|
||||
delete childItems_.value(row);
|
||||
}
|
||||
|
||||
childItems_.clear();
|
||||
}
|
||||
|
||||
QString ExpertPacketItem::groupKey(bool group_by_summary, int severity, int group, QString protocol, int expert_hf)
|
||||
|
@ -92,6 +98,11 @@ ExpertInfoModel::ExpertInfoModel(CaptureFile& capture_file, QObject *parent) :
|
|||
{
|
||||
}
|
||||
|
||||
ExpertInfoModel::~ExpertInfoModel()
|
||||
{
|
||||
delete root_;
|
||||
}
|
||||
|
||||
void ExpertInfoModel::clear()
|
||||
{
|
||||
emit beginResetModel();
|
||||
|
|
|
@ -68,6 +68,7 @@ class ExpertInfoModel : public QAbstractItemModel
|
|||
|
||||
public:
|
||||
ExpertInfoModel(CaptureFile& capture_file, QObject *parent = 0);
|
||||
virtual ~ExpertInfoModel();
|
||||
|
||||
enum ExpertColumn {
|
||||
colSeverity = 0,
|
||||
|
|
Loading…
Reference in New Issue