8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 15:23:02 +01:00

Fixed UnloadDetector in a case when it gets linked in non-plugin module

This commit is contained in:
alexpeshkoff 2011-06-14 11:34:26 +00:00
parent c9be5c00b8
commit 18ef64b242
5 changed files with 12 additions and 11 deletions

View File

@ -680,5 +680,5 @@ extern "C" void FB_PLUGIN_ENTRY_POINT(Firebird::IMaster* master)
Firebird::PluginManagerInterfacePtr pi(master);
pi->registerPluginFactory(Firebird::PluginType::AuthUserManagement, "Legacy_Auth", &factory);
pi->registerModule(&Firebird::myModule);
Firebird::myModule->registerMe();
}

View File

@ -243,19 +243,20 @@ public:
typedef void VoidNoParam();
explicit UnloadDetectorHelper(MemoryPool&)
: cleanup(NULL), flagOsUnload(true)
: cleanup(NULL), flagOsUnload(false)
{ }
void registerMe()
{
PluginManagerInterfacePtr()->registerModule(this);
flagOsUnload = true;
}
~UnloadDetectorHelper()
{
if (flagOsUnload)
{
PluginManagerInterfacePtr pi;
if (pi)
{
pi->unregisterModule(this);
}
PluginManagerInterfacePtr()->unregisterModule(this);
doClean();
}
}

View File

@ -325,7 +325,7 @@ void registerEngine(IPluginManager* iPlugin)
{
myModule->setCleanup(shutdownBeforeUnload);
iPlugin->registerPluginFactory(PluginType::Provider, "Engine12", &engineFactory);
iPlugin->registerModule(&myModule);
myModule->registerMe();
}
} // namespace Jrd

View File

@ -759,7 +759,7 @@ extern "C" void FB_PLUGIN_ENTRY_POINT(Firebird::IMaster* master)
{
PluginManagerInterfacePtr pi;
pi->registerPluginFactory(PluginType::ExternalEngine, "UDR", &factory);
pi->registerModule(&myModule);
myModule->registerMe();
libraryName->assign("fbclient");
ModuleLoader::doctorModuleExtension(libraryName);

View File

@ -128,7 +128,7 @@ static Firebird::SimpleFactory<TraceFactoryImpl> traceFactory;
void registerTrace(Firebird::IPluginManager* iPlugin)
{
iPlugin->registerPluginFactory(Firebird::PluginType::Trace, "fbtrace", &traceFactory);
iPlugin->registerModule(&Firebird::myModule);
Firebird::myModule->registerMe();
}