If we're "[Saving] the file and [closing] it", actually *close* it.

Otherwise, if you've modified the file (added, removed, or changed
comments), and you try to close the file or quit, and answer "Save" to
the "save your work?" question, Wireshark tries to clean up the wmem
scopes, but the file scope hasn't been left, and wmem crashes with an
assertion error.

(The GTK+ version does the close, so it doesn't have the bug.)

Change-Id: Ie5942e415cfab1907e29b09926a62e2679aca6ee
Reviewed-on: https://code.wireshark.org/review/15598
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2016-05-28 11:04:06 -07:00
parent a0d7121bae
commit 3fbd397d35
1 changed files with 2 additions and 1 deletions

View File

@ -1208,7 +1208,7 @@ void MainWindow::saveCaptureFile(capture_file *cf, bool dont_reopen) {
/* The write failed.
XXX - OK, what do we do now? Let them try a
"Save As", in case they want to try to save to a
different directory r file system? */
different directory or file system? */
break;
case CF_WRITE_ABORTED:
@ -1620,6 +1620,7 @@ bool MainWindow::testCaptureFileClose(QString before_what, FileCloseContext cont
#endif
/* Save the file and close it */
saveCaptureFile(capture_file_.capFile(), true);
do_close_file = true;
} else if(msg_dialog.clickedButton() == discard_button) {
/* Just close the file, discarding changes */
do_close_file = true;