From: Thomas Roessler Date: Mon, 9 Nov 1998 11:07:24 +0000 (+0000) Subject: Avoid duplicate mx_close_mailbox() when OP_QUIT is called. X-Git-Tag: mutt-0-94-16i-rel~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0320d8e62744b2c201320393e693b5dae6e881d8;p=mutt Avoid duplicate mx_close_mailbox() when OP_QUIT is called. --- diff --git a/curs_main.c b/curs_main.c index d1e0f96e..95825911 100644 --- a/curs_main.c +++ b/curs_main.c @@ -965,7 +965,11 @@ int mutt_index_menu (void) if ((menu->menu == MENU_MAIN) && (query_quadoption (OPT_QUIT, _("Exit Mutt without saving?")) == M_YES)) + { + mx_fastclose_mailbox (Context); + safe_free ((void **) &Context); done = 1; + } break; case OP_MAIN_NEXT_UNDELETED: diff --git a/main.c b/main.c index 97ed84dc..893e4d01 100644 --- a/main.c +++ b/main.c @@ -672,17 +672,9 @@ int main (int argc, char **argv) if ((Context = mx_open_mailbox (folder, ((flags & M_RO) || option (OPTREADONLY)) ? M_READONLY : 0, NULL)) != NULL) { - int close = mutt_index_menu (); - + mutt_index_menu (); if (Context) - { - if (close == OP_QUIT) - mx_close_mailbox (Context); - else - mx_fastclose_mailbox (Context); - } - - safe_free ((void **)&Context); + safe_free ((void **)&Context); mutt_endwin (NULL); } else