mirror of
https://github.com/anope/anope.git
synced 2026-07-07 19:43:14 +02:00
Remove tmp modules from the runtime folder when we can. Currently we cant remove them if we segfaulted, pretty much every other instance is now dealt with.
git-svn-id: svn://svn.anope.org/anope/trunk@936 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@670 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
2cfdc08695
commit
fbf820b4e6
+22
-20
@@ -207,36 +207,38 @@ void modules_delayed_init(void)
|
||||
* And if that isn't enough discouragement, you'll wake up with your
|
||||
* both legs broken tomorrow ;) -GD
|
||||
*/
|
||||
void modules_unload_all(void)
|
||||
void modules_unload_all(boolean fini)
|
||||
{
|
||||
#ifdef USE_MODULES
|
||||
int idx;
|
||||
ModuleHash *mh, *next;
|
||||
void (*func) (void);
|
||||
|
||||
void (*func) (void);
|
||||
|
||||
for (idx = 0; idx < MAX_CMD_HASH; idx++) {
|
||||
mh = MODULE_HASH[idx];
|
||||
while (mh) {
|
||||
next = mh->next;
|
||||
|
||||
if (prepForUnload(mh->m) != MOD_ERR_OK) {
|
||||
mh = next;
|
||||
if(fini) {
|
||||
if (prepForUnload(mh->m) != MOD_ERR_OK) {
|
||||
mh = next;
|
||||
continue;
|
||||
}
|
||||
|
||||
func = (void (*)(void))ano_modsym(mh->m->handle, "AnopeFini");
|
||||
if (func) {
|
||||
mod_current_module_name = mh->m->name;
|
||||
func(); /* exec AnopeFini */
|
||||
mod_current_module_name = NULL;
|
||||
}
|
||||
|
||||
if ((ano_modclose(mh->m->handle)) != 0)
|
||||
alog(ano_moderr());
|
||||
else
|
||||
delModule(mh->m);
|
||||
} else {
|
||||
delModule(mh->m);
|
||||
}
|
||||
|
||||
func = (void (*)(void))ano_modsym(mh->m->handle, "AnopeFini");
|
||||
if (func) {
|
||||
mod_current_module_name = mh->m->name;
|
||||
func(); /* exec AnopeFini */
|
||||
mod_current_module_name = NULL;
|
||||
}
|
||||
|
||||
if ((ano_modclose(mh->m->handle)) != 0)
|
||||
alog(ano_moderr());
|
||||
else
|
||||
delModule(mh->m);
|
||||
|
||||
mh = next;
|
||||
mh = next;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user