summaryrefslogtreecommitdiff
path: root/modules.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules.c')
-rw-r--r--modules.c20
1 files changed, 19 insertions, 1 deletions
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;