aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-06-28 14:18:41 -0700
committerGuy Harris <gharris@sonic.net>2021-06-28 21:41:31 +0000
commitbb4c32b75e649e7283af06b451b05c240066104b (patch)
tree3649ae488cb68d708d0dade0b5d0f5b13ccbc38e
parent5318290a059fb27574e9c64d44b3dd80b7756d4c (diff)
wireless timeline: add a destructor to free the hash table.
Destroy the hash table if we're destroying the timeline widget, so that it doesn't leak. (cherry picked from commit ad3e6b1be6490834d90575535d3efb6a8125767d)
-rw-r--r--ui/qt/widgets/wireless_timeline.cpp8
-rw-r--r--ui/qt/widgets/wireless_timeline.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/ui/qt/widgets/wireless_timeline.cpp b/ui/qt/widgets/wireless_timeline.cpp
index e4a1f456a4..8210201819 100644
--- a/ui/qt/widgets/wireless_timeline.cpp
+++ b/ui/qt/widgets/wireless_timeline.cpp
@@ -333,6 +333,14 @@ WirelessTimeline::WirelessTimeline(QWidget *parent) : QWidget(parent)
connect(wsApp, SIGNAL(appInitialized()), this, SLOT(appInitialized()));
}
+WirelessTimeline::~WirelessTimeline()
+{
+ if (radio_packet_list != NULL)
+ {
+ g_hash_table_destroy(radio_packet_list);
+ }
+}
+
void WirelessTimeline::setPacketList(PacketList *packet_list)
{
this->packet_list = packet_list;
diff --git a/ui/qt/widgets/wireless_timeline.h b/ui/qt/widgets/wireless_timeline.h
index 00af02db99..7f75fd357c 100644
--- a/ui/qt/widgets/wireless_timeline.h
+++ b/ui/qt/widgets/wireless_timeline.h
@@ -52,6 +52,7 @@ class WirelessTimeline : public QWidget
public:
explicit WirelessTimeline(QWidget *parent);
+ ~WirelessTimeline();
void setPacketList(PacketList *packet_list);
void captureFileReadStarted(capture_file *cf);
void captureFileReadFinished();