Skip to content

Commit

Permalink
* Patch from Luca Olivetti to fix memleak in CORS support. Fixes issu…
Browse files Browse the repository at this point in the history
…e #39886
  • Loading branch information
mvancanneyt committed Sep 8, 2022
1 parent b6a7504 commit bc100ed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/fcl-web/src/base/fphttp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
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;
Expand Down Expand Up @@ -322,6 +323,12 @@ constructor TCustomHTTPModule.CreateNew(aOwner: TComponent; CreateMode: Integer)
FCORS:=CreateCORSSupport;
end;

destructor TCustomHTTPModule.Destroy;
begin
FCORS.Free;
inherited Destroy;
end;

Class Procedure TCustomHTTPModule.RegisterModule(Const AModuleName: String);
begin
RegisterModule(AModuleName,DefaultSkipStreaming);
Expand Down

0 comments on commit bc100ed

Please sign in to comment.