You are not logged in.
Pages: 1
Hi Arnaud. i tried to upload this patch to github. But my credentials are rejected
diff --git a/SQLite3/mORMot.pas b/SQLite3/mORMot.pas
index 5b692f78..30d00b67 100644
--- a/SQLite3/mORMot.pas
+++ b/SQLite3/mORMot.pas
@@ -58447,10 +58447,11 @@ begin
else
result := fImplementationClass.Create;
end;
+ inc(TInterfacedObjectHooked(result).FRefCount); // >0 to call Support() in event
if Assigned(TSQLRestServer(Rest).OnServiceCreateInstance) then
TSQLRestServer(Rest).OnServiceCreateInstance(self,result);
- if AndIncreaseRefCount then
- IInterface(result)._AddRef; // allow passing self to sub-methods
+ if not AndIncreaseRefCount then
+ dec(TInterfacedObjectHooked(result).FRefCount);
end;
procedure TServiceFactoryServer.OnLogRestExecuteMethod(Sender: TServiceMethodExecute;
Rad Studio 12.3 Athens
Offline
I have seen you backported TServiceFactoryServer.CreateInstance refcount logic from mORMot 2.
I have pushed the modification.
See https://synopse.info/fossil/info/215152b939
Offline
thank you - yes i used a piece of code with mORMot2 and then with mORMot and under mORMot my Objekt was freed in Support...
Rad Studio 12.3 Athens
Offline
Pages: 1