diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-11-16 15:15:06 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-11-17 17:29:48 +0000 |
commit | a18f8c84cf4e8cd98a44ce3019d25fb48dc7b23e (patch) | |
tree | 5ea0562eee9a2acbc7e5bae80c6111ea92200caf | |
parent | 019715674e42c5d967d1c20f60581cca9fbad187 (diff) |
Qt: Fix Follow Dialog crash.
Don't set WA_DeleteOnClose. This keeps the dialog from deleting itself
when we're inside a nested event loop (i.e. when we're reassembling
(TCP) or retapping (UDP or TLS)).
Make sure our beginRetapPackets() and endRetapPackets() calls are
balanced. Move updateWidgets() calls to follow() so that we update on
the first run.
Bug: 11711
Change-Id: Id585be410a315b914b27f1a116d451c863087b00
Reviewed-on: https://code.wireshark.org/review/11892
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r-- | ui/qt/follow_stream_dialog.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp index a017cbcd2d..ea3c084fed 100644 --- a/ui/qt/follow_stream_dialog.cpp +++ b/ui/qt/follow_stream_dialog.cpp @@ -76,7 +76,6 @@ FollowStreamDialog::FollowStreamDialog(QWidget &parent, CaptureFile &cf, follow_ { ui->setupUi(this); - setAttribute(Qt::WA_DeleteOnClose, true); memset(&follow_info_, 0, sizeof(follow_info_)); follow_info_.show_type = SHOW_ASCII; follow_info_.show_stream = BOTH_HOSTS; @@ -293,17 +292,15 @@ void FollowStreamDialog::on_streamNumberSpinBox_valueChanged(int stream_num) if (file_closed_) return; if (stream_num >= 0) { - updateWidgets(true); follow_index((follow_type_ == FOLLOW_TCP) ? TCP_STREAM : UDP_STREAM, stream_num); follow(QString(), true); - updateWidgets(false); } } // Not sure why we have to do this manually. void FollowStreamDialog::on_buttonBox_rejected() { - reject(); + WiresharkDialog::reject(); } void FollowStreamDialog::removeStreamControls() @@ -859,7 +856,6 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) size_t nchars; gboolean is_tcp = FALSE, is_udp = FALSE; - beginRetapPackets(); resetStream(); if (file_closed_) @@ -1010,6 +1006,9 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) break; } + beginRetapPackets(); + updateWidgets(true); + /* Run the display filter so it goes in effect - even if it's the same as the previous display filter. */ emit updateFilter(follow_filter, TRUE); @@ -1034,6 +1033,8 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) //ws_close(tmp_fd); ws_unlink(data_out_filename_.toUtf8().constData()); data_out_filename_.clear(); + updateWidgets(false); + endRetapPackets(); return false; } @@ -1066,6 +1067,8 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) //ws_close(tmp_fd); ws_unlink(data_out_filename_.toUtf8().constData()); data_out_filename_.clear(); + updateWidgets(false); + endRetapPackets(); return false; } fclose(data_out_file); @@ -1241,6 +1244,7 @@ bool FollowStreamDialog::follow(QString previous_filter, bool use_stream_index) data_out_file = NULL; } + updateWidgets(false); endRetapPackets(); return true; } |