diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-07-24 10:24:15 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-07-24 20:03:28 +0000 |
commit | 7be155ee1ec61166bdf1a525902c05b378c75b66 (patch) | |
tree | cff6e59d65849227272d850e3c800e5d338f333a /ui/qt/wireshark_dialog.cpp | |
parent | d24614c77a3eb5e889dbe4caaf63b065d1bb3c4a (diff) | |
download | wireshark-7be155ee1ec61166bdf1a525902c05b378c75b66.tar.gz |
Try deleting WiresharkDialog when we close it.
QDialog::accept and ::reject hide the dialog but don't delete it. In the
case of WiresharkDialog and its subclasses we might leak memory or leave
files open. Call deleteLater when we close the dialog.
Change-Id: Ie0b848a7deeeee4667925b0d886e498f13a86bfc
Reviewed-on: https://code.wireshark.org/review/9781
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/wireshark_dialog.cpp')
-rw-r--r-- | ui/qt/wireshark_dialog.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp index 7ca270ed20..87403ade60 100644 --- a/ui/qt/wireshark_dialog.cpp +++ b/ui/qt/wireshark_dialog.cpp @@ -50,6 +50,22 @@ WiresharkDialog::WiresharkDialog(QWidget &, CaptureFile &capture_file) : setWindowTitleFromSubtitle(); } +void WiresharkDialog::accept() +{ + // We need to make sure our destructor is called. + deleteLater(); + QDialog::accept(); +} + +// XXX Should we do this in WiresharkDialog? +void WiresharkDialog::reject() +{ + // We need to make sure our destructor is called. + deleteLater(); + QDialog::reject(); +} + + void WiresharkDialog::setWindowSubtitle(const QString &subtitle) { subtitle_ = subtitle; |