From cb840222963f4986a831d5d6f9eb28d1d45083f6 Mon Sep 17 00:00:00 2001 From: Martin Kaiser Date: Wed, 24 Jun 2015 15:41:22 -0700 Subject: Qt: fix crashes when Wireshark is closed while running a capture if we haven't captured any packets yet, don't display a warning about unsaved changes make sure that we're not running into a scenario where MainWindow::testCaptureFileClose() tries to close the capture file at the same time as the pipe handler who sees an eof on the pipe cf_has_unsaved_data() should return false if we have a temporary file that contains no packets Change-Id: I18d75bd658b85d45dd3313d49e2cd654c6300de5 Reviewed-on: https://code.wireshark.org/review/9109 Reviewed-by: Evan Huus Petri-Dish: Anders Broman Petri-Dish: Gerald Combs Petri-Dish: Martin Kaiser Reviewed-by: Anders Broman --- file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'file.c') diff --git a/file.c b/file.c index 4755394963..39f500448c 100644 --- a/file.c +++ b/file.c @@ -4336,7 +4336,7 @@ cf_has_unsaved_data(capture_file *cf) * If this is a temporary file, or a file with unsaved changes, it * has unsaved data. */ - return cf->is_tempfile || cf->unsaved_changes; + return (cf->is_tempfile && cf->count>0) || cf->unsaved_changes; } /* -- cgit v1.2.3