mx_mbox_close(&Context, NULL);
else
{
- mx_fastclose_mailbox(Context);
+ mx_fastclose_mailbox(Context->mailbox);
mutt_context_free(&Context);
}
if (adata->state >= IMAP_SELECTED && (mdata->reopen & IMAP_REOPEN_ALLOW))
{
- mx_fastclose_mailbox(mdata->ctx);
+ mx_fastclose_mailbox(adata->mailbox);
mutt_socket_close(adata->conn);
mutt_error(_("Mailbox %s@%s closed"), adata->conn->account.user,
adata->conn->account.host);
{
if (Context)
{
- mx_fastclose_mailbox(Context);
+ mx_fastclose_mailbox(Context->mailbox);
mutt_context_free(&Context);
}
done = true;
/* fatal error */
mbox_unlock_mailbox(m);
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
mutt_sig_unblock();
mutt_error(_("Mailbox was corrupted"));
return -1;
adata->fp = freopen(m->path, "r+", adata->fp);
if (!adata->fp)
{
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
mutt_error(_("Fatal error! Could not reopen mailbox!"));
return -1;
}
if (!fp)
{
mutt_sig_unblock();
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
mutt_debug(1, "unable to reopen temp copy of mailbox!\n");
mutt_perror(tempfile);
FREE(&new_offset);
NONULL(Username), NONULL(ShortHostname), (unsigned int) getpid());
rename(tempfile, savefile);
mutt_sig_unblock();
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
mutt_pretty_mailbox(savefile, sizeof(savefile));
mutt_error(_("Write failed! Saved partial mailbox to %s"), savefile);
FREE(&new_offset);
{
unlink(tempfile);
mutt_sig_unblock();
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
mutt_error(_("Fatal error! Could not reopen mailbox!"));
FREE(&new_offset);
FREE(&old_offset);
if (!adata->fp)
{
mutt_error(_("Could not reopen mailbox"));
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
return -1;
}
{
if (mx_open_mailbox_append(ctx->mailbox, flags) != 0)
{
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
mutt_context_free(&ctx);
return NULL;
}
else if (m->magic == MUTT_UNKNOWN || !m->mx_ops)
mutt_error(_("%s is not a mailbox"), path);
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
mutt_context_free(&ctx);
return NULL;
}
}
else
{
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
mutt_context_free(&ctx);
}
/**
* mx_fastclose_mailbox - free up memory associated with the mailbox context
- * @param ctx Mailbox
+ * @param m Mailbox
*/
-void mx_fastclose_mailbox(struct Context *ctx)
+void mx_fastclose_mailbox(struct Mailbox *m)
{
- if (!ctx || !ctx->mailbox)
+ if (!m)
return;
- struct Mailbox *m = ctx->mailbox;
-
m->opened--;
if (m->opened != 0)
return;
if (m->readonly || m->dontwrite || m->append)
{
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
FREE(pctx);
return 0;
}
mutt_message(_("Mailbox is unchanged"));
if (m->magic == MUTT_MBOX || m->magic == MUTT_MMDF)
mbox_reset_atime(m, NULL);
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
FREE(pctx);
return 0;
}
}
#endif
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
FREE(pctx);
return 0;
!mutt_is_spool(m->path) && !SaveEmpty)
{
unlink(m->path);
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(m);
return 0;
}
int mx_access (const char *path, int flags);
void mx_alloc_memory (struct Mailbox *m);
int mx_check_empty (const char *path);
-void mx_fastclose_mailbox(struct Context *ctx);
+void mx_fastclose_mailbox(struct Mailbox *m);
const struct MxOps *mx_get_ops (enum MailboxType magic);
bool mx_tags_is_supported(struct Mailbox *m);
void mx_update_context (struct Context *ctx);
PostCount = 0;
else
PostCount = ctx->mailbox->msg_count;
- mx_fastclose_mailbox(ctx);
+ mx_fastclose_mailbox(ctx->mailbox);
mutt_context_free(&ctx);
#ifdef USE_NNTP
if (optnews)
{
if (PostContext != ctx)
{
- mx_fastclose_mailbox(PostContext);
+ mx_fastclose_mailbox(PostContext->mailbox);
FREE(&PostContext);
}
return -1;