free static stuff on shutdown.
authorWilfried Goesgens <dothebart@citadel.org>
Tue, 12 Feb 2013 22:20:03 +0000 (23:20 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Tue, 12 Feb 2013 22:20:03 +0000 (23:20 +0100)
citadel/control.c
citadel/modules/smtp/serv_smtp.c
citadel/serv_extensions.c

index c26aadbf0197cf5f99b0d64fb5c0777b410d93a8..4a09a9adc3baaa11fa95b0bf9eaf02dca56d4327 100644 (file)
@@ -826,7 +826,10 @@ void cmd_gvdn(char *argbuf)
 /*                      MODULE INITIALIZATION STUFF                          */
 /*****************************************************************************/
 
-
+void control_cleanup(void)
+{
+       DeleteHash(&CfgNameHash);
+}
 CTDL_MODULE_INIT(control)
 {
        if (!threading) {
@@ -838,6 +841,8 @@ CTDL_MODULE_INIT(control)
 
                CtdlRegisterProtoHook(cmd_gvdn, "GVDN", "get valid domain names");
                CtdlRegisterProtoHook(cmd_conf, "CONF", "get/set system configuration");
+               CtdlRegisterCleanupHook(control_cleanup);
+
        }
        /* return our id for the Log */
        return "control";
index 69a4c77ef43b3148d2210815cc22989bfd9f450d..cf8f6eb74526acc8a712ec368993a8e41c6a75f6 100644 (file)
@@ -1007,6 +1007,7 @@ CTDL_MODULE_INIT(smtp)
        if (!threading)
        {
                SMTPCmds = NewHash(1, NULL);
+               
                RegisterSmtpCMD("AUTH", smtp_auth, 0);
                RegisterSmtpCMD("DATA", smtp_data, 0);
                RegisterSmtpCMD("HELO", smtp_hello, HELO);
@@ -1060,6 +1061,7 @@ CTDL_MODULE_INIT(smtp)
                                        NULL,
                                        CitadelServiceSMTP_LMTP_UNF);
 
+               CtdlRegisterCleanupHook(smtp_cleanup);
                CtdlRegisterSessionHook(smtp_cleanup_function, EVT_STOP, PRIO_STOP + 250);
        }
        
index dee82748d13053bf27d62217b1fce1fc56a91649..cf1270cc6f7f4263027405adf887bb610b67070c 100644 (file)
@@ -579,6 +579,7 @@ void CtdlDestroyEVCleanupHooks(void)
        {
                MODM_syslog(LOG_DEBUG, "Destroyed cleanup function\n");
                p = cur->next;
+               cur->h_function_pointer();
                free(cur);
                cur = p;
        }