* Patch from Luca Olivetti to fix memleak in CORS support. Fixes issue #39886

This commit is contained in:
Michaël Van Canneyt 2022-09-08 13:10:52 +02:00
parent b6a7504665
commit bc100eda4d

View File

@ -119,6 +119,7 @@ Type
Property CORS : TCORSSupport Read FCORS Write SetCORS;
public
Constructor CreateNew(aOwner : TComponent; CreateMode: Integer); overload; override;
destructor Destroy;override;
Class Procedure RegisterModule(Const AModuleName : String = ''); overload;
Class Procedure RegisterModule(Const AModuleName : String; ASkipStreaming : Boolean); overload;
Procedure HandleRequest(ARequest : TRequest; AResponse : TResponse); virtual; abstract;
@ -322,6 +323,12 @@ begin
FCORS:=CreateCORSSupport;
end;
destructor TCustomHTTPModule.Destroy;
begin
FCORS.Free;
inherited Destroy;
end;
Class Procedure TCustomHTTPModule.RegisterModule(Const AModuleName: String);
begin
RegisterModule(AModuleName,DefaultSkipStreaming);