* flush networker caching list on exit
authorWilfried Göesgens <willi@citadel.org>
Sat, 20 Jan 2007 19:53:52 +0000 (19:53 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 20 Jan 2007 19:53:52 +0000 (19:53 +0000)
citadel/citserver.c
citadel/serv_network.c
citadel/serv_network.h

index a4f5e4cd4cbd9d7b8d76de1f348e17ef89f1669b..2c3013f43227fb373a25ccae37565982854a90a3 100644 (file)
@@ -54,6 +54,7 @@
 #include "control.h"
 #include "tools.h"
 #include "euidindex.h"
+#include "serv_network.h"
 
 #ifndef HAVE_SNPRINTF
 #include "snprintf.h"
@@ -150,9 +151,12 @@ void master_cleanup(int exitcode) {
        lprintf(CTDL_INFO, "Closing databases\n");
        close_databases();
 
+       /* flush the networker stuff */
+       destroy_network_queue_room();
+
        /* Do system-dependent stuff */
        sysdep_master_cleanup();
-
+       
 #ifdef DEBUG_MEMORY_LEAKS
        dump_heap();
 #endif
index fb18445ed23c0e575454542ff0dfbfb78bd556de..ca8bfb668365d694fff996707f36a1642e3e234f 100644 (file)
@@ -1182,6 +1182,22 @@ void network_queue_room(struct ctdlroom *qrbuf, void *data) {
        end_critical_section(S_RPLIST);
 }
 
+void destroy_network_queue_room(void)
+{
+       struct RoomProcList *cur, *p;
+
+       cur = rplist;
+       begin_critical_section(S_RPLIST);
+       while (cur != NULL)
+       {
+               p = cur->next;
+               free (cur);
+               cur = p;                
+       }
+       rplist = NULL;
+       end_critical_section(S_RPLIST);
+}
+
 
 /*
  * Learn topology from path fields
index 39e04b9d7f011b5f6c453b33ba382829849b0c37..92c2c83e43cf83c420111969eb063d212ea4b509 100644 (file)
@@ -43,3 +43,4 @@ struct FilterList {
 extern struct FilterList *filterlist;
 
 void network_queue_room(struct ctdlroom *, void *);
+void destroy_network_queue_room(void);