From e1f9c8ccec6cad3dbf24575cfe1c6329804ac64b Mon Sep 17 00:00:00 2001 From: Daniele Teti Date: Sat, 9 Nov 2024 11:18:30 +0100 Subject: [PATCH] Removed some warning realted to WebStencils integrations --- sources/MVCFramework.View.Renderers.WebStencils.pas | 2 +- sources/MVCFramework.pas | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/sources/MVCFramework.View.Renderers.WebStencils.pas b/sources/MVCFramework.View.Renderers.WebStencils.pas index a901aaea..ff7a8b93 100644 --- a/sources/MVCFramework.View.Renderers.WebStencils.pas +++ b/sources/MVCFramework.View.Renderers.WebStencils.pas @@ -35,7 +35,7 @@ interface uses MVCFramework, System.Generics.Collections, System.SysUtils, MVCFramework.Commons, System.IOUtils, System.Classes, Web.Stencils, - System.Rtti, MVCFramework.Nullables, System.DateUtils; + System.Rtti, MVCFramework.Nullables, System.DateUtils, System.TypInfo; type TMVCWebStencilsEvent = reference to procedure(const WebStencilsProcessor: TWebStencilsProcessor); diff --git a/sources/MVCFramework.pas b/sources/MVCFramework.pas index 913a5092..7b6a0231 100644 --- a/sources/MVCFramework.pas +++ b/sources/MVCFramework.pas @@ -900,6 +900,7 @@ type function GetSession: TMVCWebSession; function GetViewData(const aModelName: string): TValue; procedure SetViewData(const aModelName: string; const Value: TValue); + procedure InternalToFree(aObject: TObject); protected const CLIENTID_KEY = '__clientid'; protected @@ -4208,7 +4209,7 @@ begin Result := GetSHA1HashFromString(Data); end; -procedure TMVCController.ToFree(aObject: TObject); +procedure TMVCController.InternalToFree(aObject: TObject); begin if not Assigned(fFreeList) then begin @@ -4217,9 +4218,14 @@ begin fFreeList.Add(aObject); end; +procedure TMVCController.ToFree(aObject: TObject); +begin + InternalToFree(aObject); +end; + function TMVCController.ToFree(aObject: T): T; begin - ToFree(aObject); + InternalToFree(aObject); Result := aObject; end;