changeset 9126:9ff1e79fffab HEAD

imap: Initialize commands hash before plugins are initialized so they can register commands.
author Timo Sirainen <tss@iki.fi>
date Thu, 16 Apr 2009 21:37:37 -0400
parents dc220ff69fb8
children 922868605499
files src/imap/main.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/main.c	Thu Apr 16 20:09:12 2009 -0400
+++ b/src/imap/main.c	Thu Apr 16 21:37:37 2009 -0400
@@ -84,7 +84,6 @@
 	}
 
 	clients_init();
-	commands_init();
 
 	client = client_create(0, 1, user, set);
         client->workarounds = parse_workarounds(set);
@@ -129,7 +128,6 @@
 	if (log_io != NULL)
 		io_remove(&log_io);
 	clients_deinit();
-	commands_deinit();
 }
 
 int main(int argc, char *argv[], char *envp[])
@@ -182,6 +180,9 @@
 			i_fatal("USER environment missing");
 	}
 
+	/* plugins may want to add commands, so this needs to be called early */
+	commands_init();
+
 	mail_user = mail_storage_service_init_user(service, user, set_roots,
 						   storage_service_flags);
 	set = mail_storage_service_get_settings(service);
@@ -199,6 +200,8 @@
 
 	main_deinit();
 	mail_storage_service_deinit_user();
+	commands_deinit();
+
 	master_service_deinit(&service);
 	return 0;
 }