Skip to content

Commit 7272379

Browse files
committed
Using Py_DecRef to manage instance lifetime
1 parent a5b76af commit 7272379

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/WrapDelphi.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,7 @@ function TExposedIndexedPropertyImplementation.TIndexedPropertyAccess.GetItem(
15891589
nil,
15901590
true);
15911591
finally
1592-
GetPythonEngine().Py_CLEAR(LIndexes);
1592+
GetPythonEngine().Py_DecRef(LIndexes);
15931593
end;
15941594
end;
15951595
end;
@@ -1623,7 +1623,7 @@ function TExposedIndexedPropertyImplementation.TIndexedPropertyAccess.SetItem(
16231623
nil,
16241624
true);
16251625
finally
1626-
GetPythonEngine().Py_CLEAR(LIndexes);
1626+
GetPythonEngine().Py_DecRef(LIndexes);
16271627
end;
16281628
end else begin
16291629
LIndexes := GetPythonEngine().PyTuple_New(2);
@@ -1640,7 +1640,7 @@ function TExposedIndexedPropertyImplementation.TIndexedPropertyAccess.SetItem(
16401640
nil,
16411641
true);
16421642
finally
1643-
GetPythonEngine().Py_CLEAR(LIndexes);
1643+
GetPythonEngine().Py_DecRef(LIndexes);
16441644
end;
16451645
end;
16461646

0 commit comments

Comments
 (0)