diff --git a/ui/qt/wlan_statistics_dialog.cpp b/ui/qt/wlan_statistics_dialog.cpp index ae93f7904e..21a803945b 100644 --- a/ui/qt/wlan_statistics_dialog.cpp +++ b/ui/qt/wlan_statistics_dialog.cpp @@ -501,8 +501,10 @@ WlanStatisticsDialog::WlanStatisticsDialog(QWidget &parent, CaptureFile &cf, con << tr("Deauths") << tr("Other"); statsTreeWidget()->setHeaderLabels(header_labels); updateHeaderLabels(); - statsTreeWidget()->setItemDelegateForColumn(col_pct_packets_, new PercentBarDelegate()); - statsTreeWidget()->setItemDelegateForColumn(col_pct_retry_, new PercentBarDelegate()); + packets_delegate_ = new PercentBarDelegate(); + statsTreeWidget()->setItemDelegateForColumn(col_pct_packets_, packets_delegate_); + retry_delegate_ = new PercentBarDelegate(); + statsTreeWidget()->setItemDelegateForColumn(col_pct_retry_, retry_delegate_); statsTreeWidget()->sortByColumn(col_bssid_, Qt::AscendingOrder); // resizeColumnToContents doesn't work well here, so set sizes manually. @@ -546,6 +548,8 @@ WlanStatisticsDialog::WlanStatisticsDialog(QWidget &parent, CaptureFile &cf, con WlanStatisticsDialog::~WlanStatisticsDialog() { + delete packets_delegate_; + delete retry_delegate_; delete add_station_timer_; } diff --git a/ui/qt/wlan_statistics_dialog.h b/ui/qt/wlan_statistics_dialog.h index 2bc1233e45..b7fff75540 100644 --- a/ui/qt/wlan_statistics_dialog.h +++ b/ui/qt/wlan_statistics_dialog.h @@ -11,6 +11,7 @@ #define WLANSTATISTICSDIALOG_H #include "tap_parameter_dialog.h" +#include class QElapsedTimer; @@ -27,6 +28,7 @@ protected: private: int packet_count_; int cur_network_; + PercentBarDelegate *packets_delegate_, *retry_delegate_; QElapsedTimer *add_station_timer_; QString displayFilter_;