Skip to content

Commit 259d2e7

Browse files
committed
Fixed memory leaks in the tests
1 parent 851ee6c commit 259d2e7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Tests/NumberServicesTest.pas

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ PyTRandomInteger = class(TPyObject)
5151
function NbBool: Integer; override; // 26
5252
private
5353
function PerformArithmeticOp(obj: PPyObject; op: string): PPyObject;
54+
public
55+
destructor Destroy; override;
5456
end;
5557

5658
[TestFixture]
@@ -354,6 +356,12 @@ function PyTRandomInteger.NbPositive: PPyObject; // 8
354356
end
355357
end;
356358

359+
destructor PyTRandomInteger.Destroy;
360+
begin
361+
FRandomInteger.Free;
362+
inherited;
363+
end;
364+
357365
function PyTRandomInteger.NbAbsolute: PPyObject; // 9
358366
begin
359367
with GetPythonEngine do

Tests/WrapDelphiTest.pas

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ procedure TTestWrapDelphi.SetupFixture;
176176

177177
procedure TTestWrapDelphi.TearDownFixture;
178178
begin
179+
VarClear(Rtti_Var);
180+
VarClear(Rtti_Rec);
181+
VarClear(Rtti_Interface);
179182
PythonEngine.Free;
180183
PyDelphiWrapper.Free;
181184
DelphiModule.Free;

0 commit comments

Comments
 (0)