aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/simple_statistics_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui/qt/simple_statistics_dialog.cpp')
-rw-r--r--ui/qt/simple_statistics_dialog.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/ui/qt/simple_statistics_dialog.cpp b/ui/qt/simple_statistics_dialog.cpp
index 7e460868a5..2360330622 100644
--- a/ui/qt/simple_statistics_dialog.cpp
+++ b/ui/qt/simple_statistics_dialog.cpp
@@ -158,6 +158,7 @@ SimpleStatisticsDialog::SimpleStatisticsDialog(QWidget &parent, CaptureFile &cf,
TapParameterDialog(parent, cf, help_topic),
stu_(stu)
{
+ stu->refcount++;
setWindowSubtitle(stu_->title);
loadGeometry(0, 0, stu_->title);
@@ -285,7 +286,15 @@ void SimpleStatisticsDialog::fillTree()
tapDraw(&stat_data);
removeTapListeners();
- free_stat_tables(stu_, NULL, NULL);
+}
+
+SimpleStatisticsDialog::~SimpleStatisticsDialog()
+{
+ stu_->refcount--;
+ if (stu_->refcount == 0) {
+ if (stu_->tables)
+ free_stat_tables(stu_, NULL, NULL);
+ }
}
/*