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

Fixed build after changes in AutoPtr

This commit is contained in:
AlexPeshkoff 2023-10-18 11:46:57 +03:00
parent 5453f7c4d6
commit 359d4b89b3
2 changed files with 20 additions and 4 deletions

View File

@ -747,6 +747,12 @@ ExtEngineManager::ExtRoutine::ExtRoutine(thread_db* tdbb, ExtEngineManager* aExt
engine->addRef();
}
void ExtEngineManager::ExtRoutine::PluginDeleter::operator()(IPluginBase* ptr)
{
if (ptr)
PluginManagerInterfacePtr()->releasePlugin(ptr);
}
//---------------------
@ -770,7 +776,7 @@ ExtEngineManager::Function::~Function()
void ExtEngineManager::Function::execute(thread_db* tdbb, UCHAR* inMsg, UCHAR* outMsg) const
{
EngineAttachmentInfo* attInfo = extManager->getEngineAttachment(tdbb, engine);
EngineAttachmentInfo* attInfo = extManager->getEngineAttachment(tdbb, engine.get());
const MetaString& userName = udf->invoker ? udf->invoker->getUserName() : "";
ContextManager<IExternalFunction> ctxManager(tdbb, attInfo, function,
(udf->getName().package.isEmpty() ?
@ -821,7 +827,7 @@ ExtEngineManager::ResultSet::ResultSet(thread_db* tdbb, UCHAR* inMsg, UCHAR* out
attachment(tdbb->getAttachment()),
firstFetch(true)
{
attInfo = procedure->extManager->getEngineAttachment(tdbb, procedure->engine);
attInfo = procedure->extManager->getEngineAttachment(tdbb, procedure->engine.get());
const MetaString& userName = procedure->prc->invoker ? procedure->prc->invoker->getUserName() : "";
ContextManager<IExternalProcedure> ctxManager(tdbb, attInfo, procedure->procedure,
(procedure->prc->getName().package.isEmpty() ?
@ -931,7 +937,7 @@ ExtEngineManager::Trigger::~Trigger()
void ExtEngineManager::Trigger::execute(thread_db* tdbb, Request* request, unsigned action,
record_param* oldRpb, record_param* newRpb) const
{
EngineAttachmentInfo* attInfo = extManager->getEngineAttachment(tdbb, engine);
EngineAttachmentInfo* attInfo = extManager->getEngineAttachment(tdbb, engine.get());
const TriState& ssDefiner = trg->ssDefiner.isAssigned() ? trg->ssDefiner :
(trg->relation && trg->relation->rel_ss_definer.isAssigned() ? trg->relation->rel_ss_definer : TriState());
const MetaString& userName = ssDefiner.asBool() ?

View File

@ -24,6 +24,9 @@
#define JRD_EXT_ENGINE_MANAGER_H
#include "firebird/Interface.h"
#include <memory>
#include "../common/classes/array.h"
#include "../common/classes/fb_string.h"
#include "../common/classes/GenericMap.h"
@ -216,9 +219,16 @@ public:
ExtRoutine(thread_db* tdbb, ExtEngineManager* aExtManager,
Firebird::IExternalEngine* aEngine, RoutineMetadata* aMetadata);
private:
class PluginDeleter
{
public:
void operator()(Firebird::IPluginBase* ptr);
};
protected:
ExtEngineManager* extManager;
Firebird::AutoPlugin<Firebird::IExternalEngine> engine;
std::unique_ptr<Firebird::IExternalEngine, PluginDeleter> engine;
Firebird::AutoPtr<RoutineMetadata> metadata;
Database* database;
};