aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-03-11 20:08:54 +0000
committerGuy Harris <guy@alum.mit.edu>2012-03-11 20:08:54 +0000
commit681c29c5d51bd9ff11f5862089e727204f092304 (patch)
tree9bc53e8eef4f041dfa5eb3473f156604f1f515ad /capture.c
parent6f3ee54d62bf22540d1e770f304c714a8424fdd3 (diff)
Don't close the currently loaded capture file in capture_start(), do so
in its callers; when starting a capture with "wireshark -k", there's no capture file to close, and closing it might be provoking some UI actions that cause crashes on Windows. Don't copy the list of selected interfaces to the list of capture interfaces in capture_start(), either, do that in the callers; we were already doing that in one place and, in one of the remaining cases, namely "wireshark -k", we should do so only if no capture interfaces were supplied on the command line. (I.e., the set of interfaces on which we want to capture depends on where in the UI the capture is being started.) svn path=/trunk/; revision=41491
Diffstat (limited to 'capture.c')
-rw-r--r--capture.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/capture.c b/capture.c
index b9c2f98f29..ddb0657741 100644
--- a/capture.c
+++ b/capture.c
@@ -138,13 +138,7 @@ capture_start(capture_options *capture_opts)
guint i;
GString *source = g_string_new("");
- if (capture_opts->state != CAPTURE_STOPPED)
- return FALSE;
capture_opts->state = CAPTURE_PREPARING;
-
- /* close the currently loaded capture file */
- cf_close(capture_opts->cf);
- collect_ifaces(capture_opts);
g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Start ...");
#ifdef _WIN32
if (capture_opts->ifaces->len < 2) {
@@ -654,6 +648,10 @@ capture_input_closed(capture_options *capture_opts, gchar *msg)
if (capture_opts->ifaces->len == 0) {
collect_ifaces(capture_opts);
}
+
+ /* close the currently loaded capture file */
+ cf_close(capture_opts->cf);
+
capture_start(capture_opts);
} else {
/* We're not doing a capture any more, so we don't have a save file. */