* move freeing of the event log to a separate, virtual method so that this can be changed depending on the needs of TCustomWebApplication.CreateEventLog (e.g. when using a TCustomWebApplication descendant together with a TDaemonApplication)

This commit is contained in:
Sven Barth 2021-09-06 22:39:04 +02:00
parent 86d4820760
commit 7c6f3810e3

View File

@ -139,6 +139,7 @@ Type
protected
Procedure DoRun; override;
Function CreateEventLog : TEventLog; virtual;
procedure FreeEventLog(AEventLog: TEventLog); virtual;
function InitializeWebHandler: TWebHandler; virtual; abstract;
Procedure DoLog(EventType: TEventType; const Msg: String); override;
procedure SetTitle(const AValue: string); override;
@ -579,6 +580,11 @@ begin
end;
end;
procedure TCustomWebApplication.FreeEventLog(AEventLog: TEventLog);
begin
AEventLog.Free;
end;
function TCustomWebApplication.GetEventLog: TEventLog;
begin
@ -731,8 +737,7 @@ end;
destructor TCustomWebApplication.Destroy;
begin
FWebHandler.Free;
if assigned(FEventLog) then
FEventLog.Free;
FreeEventLog(FEventLog);
Inherited;
end;