summaryrefslogtreecommitdiffstats
path: root/modules.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules.c')
-rw-r--r--modules.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules.c b/modules.c
index 01bba104..5ecceecd 100644
--- a/modules.c
+++ b/modules.c
@@ -308,6 +308,27 @@ void modPrintList(void)
}
+/* unload all modules and free module linked list
+ * rgerhards, 2007-08-09
+ */
+rsRetVal modUnloadAndDestructAll(void)
+{
+ DEFiRet;
+ modInfo_t *pMod;
+ modInfo_t *pModPrev;
+
+ pMod = modGetNxt(NULL);
+ while(pMod != NULL) {
+ pModPrev = pMod;
+ pMod = modGetNxt(pModPrev); /* get next */
+ /* now we can destroy the previous module */
+ dbgprintf("Unloading module %s\n", modGetName(pModPrev));
+ modUnload(pModPrev);
+ moduleDestruct(pModPrev);
+ }
+
+ return iRet;
+}
/*
* vi:set ai:
*/