summaryrefslogtreecommitdiff
path: root/ui/qt/main_window.cpp
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2016-06-13 20:02:46 +0200
committerAnders Broman <a.broman58@gmail.com>2016-06-23 07:58:29 +0000
commit2c8056acdf267c8e36fdfb6a3af286972d27f655 (patch)
tree7f57f1f47bdde0070cbdffe009e9cb5e5a704032 /ui/qt/main_window.cpp
parentbf29a5cdea83ffe30f957dc9432c9e54b1db6e19 (diff)
downloadwireshark-2c8056acdf267c8e36fdfb6a3af286972d27f655.tar.gz
Qt: quit the UI if WIRESHARK_QUIT_AFTER_CAPTURE is set (offline mode too).
This change is useful to use the offline mode in tests (like fuzzing) that require the software to quit after the processing of a sample. Change-Id: I311c642edecf4012dc518c2bf8bca66c97aa1b02 Reviewed-on: https://code.wireshark.org/review/16038 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/main_window.cpp')
-rw-r--r--ui/qt/main_window.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 4e2e637d91..137aae78a8 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -246,6 +246,11 @@ simple_message_box(ESD_TYPE_E type, gboolean *notagain,
void
vsimple_error_message_box(const char *msg_format, va_list ap)
{
+ // We want to quit after reading the capture file, hence
+ // we don't actually open the error dialog.
+ if (global_capture_opts.quit_after_cap)
+ exit(0);
+
SimpleDialog sd(gbl_cur_main_window_, ESD_TYPE_ERROR, ESD_BTN_OK, msg_format, ap);
sd.exec();
}