+ Instance->Log(DEBUG,"ModuleManager::SetPriority called by %s, priority state %s num_modules=%u", GetModuleName(mod).c_str(), s == PRIO_BEFORE ? "PRIO_BEFORE" :
+ s == PRIO_AFTER ? "PRIO_AFTER" :
+ s == PRIO_LAST ? "PRIO_LAST" :
+ s == PRIO_FIRST ? "PRIO_FIRST" : "<unknown!>",
+ sz);
+
size_t swap_pos;
size_t source = 0;
bool swap = true;
@@ -257,6+266,19 @@ bool ModuleManager::SetPriority(Module* mod, Implementation i, PriorityState s,
if (!found)
return false;
+ Instance->Log(DEBUG,"ModuleManager::SetPriority: My position: %u", source);
+ Instance->Log(DEFAULT,"Failed to unload module %s, being used by %d other(s) via interface '%s'",filename, intercount.first, intercount.second.c_str());
+ snprintf(MODERR,MAXBUF,"Module not unloadable (Still in use by %d other module%s which %s using its interface '%s') -- unload dependent modules first!",
- Instance->Log(DEFAULT,"Failed to unload module %s, being used by %d other(s) via interface '%s'",filename, intercount.first, intercount.second.c_str());
- snprintf(MODERR,MAXBUF,"Module not unloadable (Still in use by %d other module%s which %s using its interface '%s') -- unload dependent modules first!",
- intercount.first,
- intercount.first > 1 ? "s" : "",
- intercount.first > 1 ? "are" : "is",
- intercount.second.c_str());
- return false;
- }
- /* Give the module a chance to tidy out all its metadata */
- for (chan_hash::iterator c = Instance->chanlist->begin(); c != Instance->chanlist->end(); c++)
- {
- modules[j]->OnCleanup(TYPE_CHANNEL,c->second);
- }
- for (user_hash::iterator u = Instance->clientlist->begin(); u != Instance->clientlist->end(); u++)