aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt
diff options
context:
space:
mode:
authorJirka Novak <j.novak@netsystem.cz>2020-01-05 23:33:04 +0100
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2020-01-06 09:07:20 +0000
commit17cd230a03da48667372b758a71534b9508bfa0d (patch)
tree87e18465a099c4aad382d48b8d2fd4e54b842779 /ui/qt
parent376d8770121ab848ee4b679f2aa18bea13e42742 (diff)
voip_calls_dialog: avoiding of 'remove_tap_listener(): no listener ...' warning
When voip_calls_dialog is opened and then closed, mentioned warning is shown because voip_calls_remove_all_tap_listeners is called twice in two different methods. Removing of the call from one of method is not possible therefore I introduced variable which tracks whether voip_calls_remove_all_tap_listeners was already called or not. Change-Id: Ic3c206cb7baf6612958d383880af296af019ffd8 Reviewed-on: https://code.wireshark.org/review/35660 Petri-Dish: Jim Young <jim.young.ws@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Jim Young <jim.young.ws@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/voip_calls_dialog.cpp18
-rw-r--r--ui/qt/voip_calls_dialog.h1
2 files changed, 15 insertions, 4 deletions
diff --git a/ui/qt/voip_calls_dialog.cpp b/ui/qt/voip_calls_dialog.cpp
index 09767b55c9..3806825a7e 100644
--- a/ui/qt/voip_calls_dialog.cpp
+++ b/ui/qt/voip_calls_dialog.cpp
@@ -44,7 +44,8 @@ enum { voip_calls_type_ = 1000 };
VoipCallsDialog::VoipCallsDialog(QWidget &parent, CaptureFile &cf, bool all_flows) :
WiresharkDialog(parent, cf),
ui(new Ui::VoipCallsDialog),
- parent_(parent)
+ parent_(parent),
+ voip_calls_tap_listeners_removed_(false)
{
ui->setupUi(this);
loadGeometry(parent.width() * 4 / 5, parent.height() * 2 / 3);
@@ -104,14 +105,20 @@ VoipCallsDialog::~VoipCallsDialog()
delete ui;
voip_calls_reset_all_taps(&tapinfo_);
- voip_calls_remove_all_tap_listeners(&tapinfo_);
+ if (!voip_calls_tap_listeners_removed_) {
+ voip_calls_remove_all_tap_listeners(&tapinfo_);
+ voip_calls_tap_listeners_removed_ = true;
+ }
sequence_info_->unref();
g_queue_free(tapinfo_.callsinfos);
}
void VoipCallsDialog::removeTapListeners()
{
- voip_calls_remove_all_tap_listeners(&tapinfo_);
+ if (!voip_calls_tap_listeners_removed_) {
+ voip_calls_remove_all_tap_listeners(&tapinfo_);
+ voip_calls_tap_listeners_removed_ = true;
+ }
WiresharkDialog::removeTapListeners();
}
@@ -121,7 +128,10 @@ void VoipCallsDialog::captureFileClosing()
// the cache is active, the ToD cannot be modified.
ui->todCheckBox->setEnabled(false);
cache_model_->setSourceModel(NULL);
- voip_calls_remove_all_tap_listeners(&tapinfo_);
+ if (!voip_calls_tap_listeners_removed_) {
+ voip_calls_remove_all_tap_listeners(&tapinfo_);
+ voip_calls_tap_listeners_removed_ = true;
+ }
tapinfo_.session = NULL;
WiresharkDialog::captureFileClosing();
}
diff --git a/ui/qt/voip_calls_dialog.h b/ui/qt/voip_calls_dialog.h
index 4b9d163038..f1bf5c5efb 100644
--- a/ui/qt/voip_calls_dialog.h
+++ b/ui/qt/voip_calls_dialog.h
@@ -65,6 +65,7 @@ private:
QPushButton *sequence_button_;
QPushButton *player_button_;
QPushButton *copy_button_;
+ bool voip_calls_tap_listeners_removed_;
// Tap callbacks
// static void tapReset(void *tapinfo_ptr);