changeset 10348:3f0752af52db HEAD

auth: Unload modules earlier to avoid crashes.
author Timo Sirainen <tss@iki.fi>
date Tue, 17 Nov 2009 18:53:09 -0500
parents 0156d98bc822
children 9670b1268a9a
files src/auth/main.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/main.c	Tue Nov 17 18:34:29 2009 -0500
+++ b/src/auth/main.c	Tue Nov 17 18:53:09 2009 -0500
@@ -97,16 +97,19 @@
 	auth_master_connections_deinit();
         auth_worker_server_deinit();
 
-	userdbs_deinit();
-	passdbs_deinit();
 	mech_deinit(auth->set);
 	auth_deinit(&auth);
 
+	/* allow modules to unregister their dbs/drivers/etc. before freeing
+	   the whole data structures containing them. */
+	module_dir_unload(&modules);
+
+	userdbs_deinit();
+	passdbs_deinit();
         password_schemes_deinit();
 	sql_drivers_deinit();
 	random_deinit();
 
-	module_dir_unload(&modules);
 	array_free(&listen_fd_types);
 }