1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 13:36:38 +02:00

Fix Windows build and update library names to the newer ones.

Also fix crash on Windows when unloading a module because it threw an
exception.
This commit is contained in:
Adam
2014-05-30 15:45:57 -04:00
parent 93bfd4cbe1
commit f20bac996d
12 changed files with 38 additions and 12 deletions
+17 -7
View File
@@ -185,6 +185,7 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u)
Module *m;
ModuleReturn moderr = MOD_ERR_OK;
try
{
m = func(modname, nick);
@@ -192,9 +193,14 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u)
catch (const ModuleException &ex)
{
Log() << "Error while loading " << modname << ": " << ex.GetReason();
/*if (dlclose(handle))
Log() << dlerror();*/
return MOD_ERR_EXCEPTION;
moderr = MOD_ERR_EXCEPTION;
}
if (moderr != MOD_ERR_OK)
{
if (dlclose(handle))
Log() << dlerror();
return moderr;
}
m->filename = pbuf;
@@ -236,18 +242,22 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u)
catch (const ModuleException &ex)
{
Log() << "Module " << modname << " couldn't load:" << ex.GetReason();
DeleteModule(m);
return MOD_ERR_EXCEPTION;
moderr = MOD_ERR_EXCEPTION;
}
catch (const ConfigException &ex)
{
Log() << "Module " << modname << " couldn't load due to configuration problems: " << ex.GetReason();
DeleteModule(m);
return MOD_ERR_EXCEPTION;
moderr = MOD_ERR_EXCEPTION;
}
catch (const NotImplementedException &ex)
{
}
if (moderr != MOD_ERR_OK)
{
DeleteModule(m);
return moderr;
}
Log(LOG_DEBUG) << "Module " << modname << " loaded.";