diff options
author | Gerald Combs <gerald@wireshark.org> | 2021-11-10 11:48:26 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2021-11-10 11:48:26 -0800 |
commit | eda588d1a62bb3cff107f08d0b6310049708d069 (patch) | |
tree | 660d811a5bc39fa43af82a7040a417c36f0d35d6 /ui/qt/funnel_statistics.cpp | |
parent | 7a30021aefa1810b03f330fcbd07dcafff593a7a (diff) |
Revert "Qt: fix memory leaks found by Visual Leak Detector"
This reverts commit c2edb44a9ac2bcd6bff267bd4d7301caff248eca.
While we should definitely avoid leaking memory, this runs up against
the Qt code's assumption that it will always have valid epan data.
Fixes #17590.
Fixes #17719.
Diffstat (limited to 'ui/qt/funnel_statistics.cpp')
-rw-r--r-- | ui/qt/funnel_statistics.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/qt/funnel_statistics.cpp b/ui/qt/funnel_statistics.cpp index a56492c339..4bbaba8828 100644 --- a/ui/qt/funnel_statistics.cpp +++ b/ui/qt/funnel_statistics.cpp @@ -155,8 +155,13 @@ FunnelStatistics::FunnelStatistics(QObject *parent, CaptureFile &cf) : FunnelStatistics::~FunnelStatistics() { - delete(funnel_ops_id_); - delete(funnel_ops_); + // At this point we're probably closing the program and will shortly + // call epan_cleanup, which calls ProgDlg__gc and TextWindow__gc. + // They in turn depend on funnel_ops_ being valid. + memset(funnel_ops_id_, 0, sizeof(struct _funnel_ops_id_t)); + memset(funnel_ops_, 0, sizeof(struct _funnel_ops_t)); + // delete(funnel_ops_id_); + // delete(funnel_ops_); } void FunnelStatistics::retapPackets() |