dovecot-2.0: Don't call module's deinit() if its init() hasn't b...

dovecot at dovecot.org dovecot at dovecot.org
Thu Mar 4 20:19:07 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/65a91a112d7f
changeset: 10834:65a91a112d7f
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Mar 04 20:00:43 2010 +0200
description:
Don't call module's deinit() if its init() hasn't been called.

diffstat:

 src/lib/module-dir.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (24 lines):

diff -r df4d4fd0db00 -r 65a91a112d7f src/lib/module-dir.c
--- a/src/lib/module-dir.c	Thu Mar 04 20:00:01 2010 +0200
+++ b/src/lib/module-dir.c	Thu Mar 04 20:00:43 2010 +0200
@@ -56,7 +56,7 @@
 
 static void module_free(struct module *module)
 {
-	if (module->deinit != NULL)
+	if (module->deinit != NULL && module->initialized)
 		module->deinit();
 	if (dlclose(module->handle) != 0)
 		i_error("dlclose(%s) failed: %m", module->path);
@@ -361,9 +361,9 @@
 		for (i = 0; i < count; i++) {
 			module = rev[i];
 
-			if (module->deinit != NULL) {
+			if (module->deinit != NULL && module->initialized) {
 				module->deinit();
-				module->deinit = NULL;
+				module->initialized = FALSE;
 			}
 		}
 	} T_END;


More information about the dovecot-cvs mailing list