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

Fixed bug CORE-4906 : AV when server is shutted down with active trace session(s)

This commit is contained in:
hvlad 2015-08-12 13:38:20 +00:00
parent 363c0fae9b
commit 2291a41e8f
3 changed files with 10 additions and 3 deletions

View File

@ -83,7 +83,10 @@ const char* TracePluginImpl::marshal_exception(const Firebird::Exception& ex)
return get_error_string(); return get_error_string();
} }
TracePluginImpl::TracePluginImpl(const TracePluginConfig& configuration, ITraceInitInfo* initInfo) : TracePluginImpl::TracePluginImpl(IPluginBase* plugin,
const TracePluginConfig& configuration,
ITraceInitInfo* initInfo) :
factory(plugin),
operational(false), operational(false),
session_id(initInfo->getTraceSessionID()), session_id(initInfo->getTraceSessionID()),
session_name(*getDefaultMemoryPool()), session_name(*getDefaultMemoryPool()),

View File

@ -134,11 +134,15 @@ public:
typedef Firebird::BePlusTree<ServiceData, ServiceId, Firebird::MemoryPool, ServiceData> typedef Firebird::BePlusTree<ServiceData, ServiceId, Firebird::MemoryPool, ServiceData>
ServicesTree; ServicesTree;
TracePluginImpl(const TracePluginConfig& configuration, Firebird::ITraceInitInfo* initInfo); TracePluginImpl(Firebird::IPluginBase* factory, const TracePluginConfig& configuration, Firebird::ITraceInitInfo* initInfo);
private: private:
~TracePluginImpl(); ~TracePluginImpl();
// Used to not allow to destroy plugin factory and unload dll\so if
// instance of TracePluginImpl class exists
Firebird::RefPtr<Firebird::IPluginBase> factory;
bool operational; // Set if plugin is fully initialized and is ready for logging bool operational; // Set if plugin is fully initialized and is ready for logging
// Keep this member field first to ensure its correctness // Keep this member field first to ensure its correctness
// when destructor is called // when destructor is called

View File

@ -90,7 +90,7 @@ Firebird::ITracePlugin* TraceFactoryImpl::trace_create(Firebird::CheckStatusWrap
if (logWriter) if (logWriter)
config.log_filename = ""; config.log_filename = "";
return new TracePluginImpl(config, initInfo); // Everything is ok, we created a plugin return new TracePluginImpl(this, config, initInfo); // Everything is ok, we created a plugin
} }
catch (Firebird::Exception& ex) catch (Firebird::Exception& ex)