From: Richard Russon Date: Thu, 18 Jul 2019 14:58:00 +0000 (+0100) Subject: notify: fix shutdown order X-Git-Tag: 2019-10-25~125 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=00f96f2bf4cbfcb010432c85af1b7edf424cf7d7;p=neomutt notify: fix shutdown order Free the Notify object after we free anyone who might use it. --- diff --git a/core/account.c b/core/account.c index 5e34556ec..3fb718d9c 100644 --- a/core/account.c +++ b/core/account.c @@ -116,7 +116,6 @@ void account_free(struct Account **ptr) return; struct Account *a = *ptr; - notify_free(&a->notify); if (a->free_adata) a->free_adata(&a->adata); @@ -124,6 +123,7 @@ void account_free(struct Account **ptr) account_mailbox_remove(a, NULL); cs_subset_free(&a->sub); FREE(&a->name); + notify_free(&a->notify); FREE(ptr); } diff --git a/core/mailbox.c b/core/mailbox.c index 297b3880f..c914091ab 100644 --- a/core/mailbox.c +++ b/core/mailbox.c @@ -59,7 +59,6 @@ void mailbox_free(struct Mailbox **ptr) struct Mailbox *m = *ptr; mailbox_changed(m, MBN_CLOSED); - notify_free(&m->notify); if (m->mdata && m->free_mdata) m->free_mdata(&m->mdata); @@ -67,6 +66,7 @@ void mailbox_free(struct Mailbox **ptr) mutt_buffer_free(&m->pathbuf); FREE(&m->name); FREE(&m->realpath); + notify_free(&m->notify); FREE(ptr); } diff --git a/core/neomutt.c b/core/neomutt.c index d6c919a3d..0736b06de 100644 --- a/core/neomutt.c +++ b/core/neomutt.c @@ -66,10 +66,10 @@ void neomutt_free(struct NeoMutt **ptr) return; struct NeoMutt *n = *ptr; - notify_free(&n->notify); neomutt_account_remove(n, NULL); cs_subset_free(&n->sub); + notify_free(&n->notify); FREE(ptr); }