Skip to content

Commit

Permalink
Fix some minor (compile time) memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Sep 16, 2023
1 parent a46543d commit 671ed33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/Simba.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

begin
{$IF DECLARED(SetHeapTraceOutput)}
SetHeapTraceOutput(IntToStr(GetProcessID()) + '.trc');
SetHeapTraceOutput(Application.Location + '/' + IntToStr(GetProcessID()) + '.trc');
{$ENDIF}

Application.CaptureExceptions := False;
Expand Down
7 changes: 7 additions & 0 deletions Source/script/simba.script.pas
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,14 @@ destructor TSimbaScript.Destroy;
FPlugins := nil;

if (FCompiler <> nil) then
begin
if (FCompiler.Globals['HTTPClient'] <> nil) then
TObject(FCompiler.Globals['HTTPClient'].Ptr^).Free();
if (FCompiler.Globals['ASyncMouse'] <> nil) then
TObject(FCompiler.Globals['ASyncMouse'].Ptr^).Free();

FreeAndNil(FCompiler);
end;
if (FSimbaCommunication <> nil) then
FreeAndNil(FSimbaCommunication);

Expand Down
2 changes: 1 addition & 1 deletion Third-Party/lape
Submodule lape updated 1 files
+55 −53 lpcompiler.pas

0 comments on commit 671ed33

Please sign in to comment.