]> granicus.if.org Git - mutt/commitdiff
Avoid duplicate mx_close_mailbox() when OP_QUIT is called.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 9 Nov 1998 11:07:24 +0000 (11:07 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 9 Nov 1998 11:07:24 +0000 (11:07 +0000)
curs_main.c
main.c

index d1e0f96e1489422a4d5c2fdad0085fd2cf0cb94f..958259119a596f651bb13edab1de201d72bfa69f 100644 (file)
@@ -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 97ed84dc33596b0d7b6b0b88367c4d81cf9b2b5e..893e4d017de0c6923e0fc93171eb99282e84dfaf 100644 (file)
--- 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