summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules.c b/modules.c
index cfbe20ac..4f4fed11 100644
--- a/modules.c
+++ b/modules.c
@@ -515,6 +515,10 @@ modUnloadAndDestructAll(eModLinkType_t modLinkTypesToUnload)
if(modUnlinkAndDestroy(&pModCurr) == RS_RET_MODULE_STILL_REFERENCED) {
pModCurr = GetNxt(pModCurr);
}
+ /* Note: if the module was successfully unloaded, it has updated the
+ * pModCurr pointer to the next module. So we do NOT need to advance
+ * to the next module on successful unload.
+ */
} else {
pModCurr = GetNxt(pModCurr);
}