From c5cb6ef9fe5faffab9630a2d2684e7373f32403f Mon Sep 17 00:00:00 2001 From: "rob rob@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Sun, 2 May 2004 10:34:58 +0000 Subject: BUILD : 1.7.2 (80) BUGS : N/A NOTES : Added Memos/ChannelInfo to the moduleAddData() system git-svn-id: svn://svn.anope.org/anope/trunk@80 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@56 5417fbe8-f217-4b02-8779-1006273d7864 --- modules.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'modules.c') diff --git a/modules.c b/modules.c index 04451d5bc..6e7564ddc 100644 --- a/modules.c +++ b/modules.c @@ -1939,10 +1939,12 @@ void moduleDelAllData(ModuleData * md[]) void moduleDelAllDataMod(Module * m) { boolean freeme = false; - int i; + int i, j; User *user; NickAlias *na; NickCore *nc; + ChannelInfo *ci; + if (!mod_current_module_name) { mod_current_module_name = sstrdup(m->name); freeme = true; @@ -1956,12 +1958,28 @@ void moduleDelAllDataMod(Module * m) /* Remove the nick Cores */ for (nc = nclists[i]; nc; nc = nc->next) { moduleDelAllData(nc->moduleData); + /* Remove any memo data for this nick core */ + for (j = 0; j < nc->memos.memocount; j++) { + moduleCleanStruct(nc->memos.memos[j].moduleData); + } } /* Remove the nick Aliases */ for (na = nalists[i]; na; na = na->next) { moduleDelAllData(na->moduleData); } } + + for (i = 0; i < 256; i++) { + /* Remove any chan info data */ + for (ci = chanlists[i]; ci; ci = ci->next) { + moduleDelAllData(ci->moduleData); + /* Remove any memo data for this nick core */ + for (j = 0; j < ci->memos.memocount; j++) { + moduleCleanStruct(ci->memos.memos[j].moduleData); + } + } + } + if (freeme) { free(mod_current_module_name); mod_current_module_name = NULL; -- cgit