void mail_log_plugin_deinit(void)
{
mail_storage_hooks_remove(&mail_log_mail_storage_hooks);
- notify_unregister(mail_log_ctx);
+ notify_unregister(&mail_log_ctx);
}
const char *mail_log_plugin_dependencies[] = { "notify", NULL };
dict_wait(nuser->dict);
dict_deinit(&nuser->dict);
- if (nuser->context != NULL)
- notify_unregister(nuser->context);
+ notify_unregister(&nuser->context);
nuser->module_ctx.super.deinit(user);
}
return ctx;
}
-void notify_unregister(struct notify_context *ctx)
+void notify_unregister(struct notify_context **_ctx)
{
+ struct notify_context *ctx = *_ctx;
+
+ if (ctx == NULL)
+ return;
+ *_ctx = NULL;
+
struct notify_mail_txn *mail_txn = ctx->mail_txn_list;
for (; mail_txn != NULL; mail_txn = mail_txn->next) {
struct notify_context *
notify_register(const struct notify_vfuncs *vfuncs);
-void notify_unregister(struct notify_context *ctx);
+void notify_unregister(struct notify_context **ctx);
void notify_plugin_init(struct module *module);
void notify_plugin_deinit(void);
push_notification_event_unregister_rfc5423_events();
mail_storage_hooks_remove(&push_notification_storage_hooks);
- notify_unregister(push_notification_ctx);
+ notify_unregister(&push_notification_ctx);
}
i_free_and_null(fifo_path);
mail_storage_hooks_remove(&replication_mail_storage_hooks);
- notify_unregister(replication_ctx);
+ notify_unregister(&replication_ctx);
}
const char *replication_plugin_dependencies[] = { "notify", NULL };