* shut down libical apropriate.
authorWilfried Göesgens <willi@citadel.org>
Sun, 21 Jan 2007 10:41:50 +0000 (10:41 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 21 Jan 2007 10:41:50 +0000 (10:41 +0000)
* first guesses of destroying remaining session objects

citadel/serv_calendar.c
citadel/serv_extensions.h
citadel/sysdep.c

index 7833ab84fd00866680c425681379bca7b091934e..b7871e8e52bbc2a8fb66c3d8cf7999c26ccf837c 100644 (file)
@@ -1770,6 +1770,7 @@ void ical_send_out_invitations(icalcomponent *cal) {
                        valid = validate_recipients(attendees_string);
                        CtdlSubmitMsg(msg, valid, "");
                        CtdlFreeMessage(msg);
+                       free (valid);
                }
        }
        free(serialized_request);
@@ -2163,6 +2164,9 @@ char *serv_calendar_init(void)
 
 
 
-
-
-
+void serv_calendar_destroy(void)
+{
+#ifdef CITADEL_WITH_CALENDAR_SERVICE
+       icaltimezone_free_builtin_timezones();
+#endif
+}
index b4930e622b92874f0f87ec6ce7e08a6ad6b6b4a2..4ed2b5369d26992b31fa0e4aab56613f35326866 100644 (file)
@@ -12,6 +12,7 @@
  */
 char *serv_bio_init(void);
 char *serv_calendar_init(void);
+void serv_calendar_destroy(void);
 char *serv_notes_init(void);
 char *serv_ldap_init(void);
 char *serv_chat_init(void);
index f12c6babcc21b084953b6001d57b8decefcc4e10..8986c9ed72879838bcba0ee4c9030ef6d35130f6 100644 (file)
@@ -721,6 +721,7 @@ int client_getln(char *buf, int bufsize)
 void sysdep_master_cleanup(void) {
        struct ServiceFunctionHook *serviceptr;
 
+/////  DestroyWorkerList();
        /*
         * close all protocol master sockets
         */
@@ -745,6 +746,7 @@ void sysdep_master_cleanup(void) {
 #ifdef HAVE_OPENSSL
        destruct_ssl();
 #endif
+       serv_calendar_destroy();
        CtdlDestroyProtoHooks();
        CtdlDestroyDeleteHooks();
        CtdlDestroyXmsgHooks();
@@ -755,7 +757,6 @@ void sysdep_master_cleanup(void) {
        CtdlDestroyFixedOutputHooks();  
        CtdlDestroySessionHooks();
        CtdlDestroyServiceHook();
-       DestroyWorkerList();
 }
 
 
@@ -947,6 +948,25 @@ void create_worker(void) {
 
 void DestroyWorkerList(void)
 {
+       struct CitContext *ptr;         /* general-purpose utility pointer */
+       struct CitContext *rem = NULL;  /* list of sessions to be destroyed */
+
+       begin_critical_section(S_SESSION_TABLE);
+       ptr = ContextList;
+       while (ptr != NULL){
+               /* Remove the session from the active list */
+               rem = ptr->next;
+               --num_sessions;
+               
+               lprintf(CTDL_DEBUG, "Purging session %d\n", rem->cs_pid);
+               end_critical_section(S_SESSION_TABLE);
+               RemoveContext(ptr);
+               begin_critical_section(S_SESSION_TABLE);
+               free (ptr);
+               ptr = rem;
+       }
+       end_critical_section(S_SESSION_TABLE);
+
        struct worker_node *cur, *p;
        cur = worker_list;
        while (cur != NULL)