Skip to content

Commit 69d8578

Browse files
committed
Removed unused TPythonEngine.Lock/Unlock
1 parent 45aef24 commit 69d8578

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

Source/PythonEngine.pas

-15
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,6 @@ TPythonEngine = class(TPythonInterface)
17481748
FRedirectIO: Boolean;
17491749
FOnAfterInit: TNotifyEvent;
17501750
FClients: TList;
1751-
FLock: TCriticalSection;
17521751
FExecModule: AnsiString;
17531752
FAutoFinalize: Boolean;
17541753
FProgramName: UnicodeString;
@@ -1801,8 +1800,6 @@ TPythonEngine = class(TPythonInterface)
18011800
destructor Destroy; override;
18021801

18031802
// Public methods
1804-
procedure Lock;
1805-
procedure Unlock;
18061803
procedure SetPythonHome(const PythonHome: UnicodeString);
18071804
procedure SetProgramName(const ProgramName: UnicodeString);
18081805
function IsType(ob: PPyObject; obt: PPyTypeObject): Boolean;
@@ -3936,7 +3933,6 @@ constructor TPythonEngine.Create(AOwner: TComponent);
39363933
i : Integer;
39373934
begin
39383935
inherited;
3939-
FLock := TCriticalSection.Create;
39403936
FInitScript := TstringList.Create;
39413937
FClients := TList.Create;
39423938
FRedirectIO := True;
@@ -3968,7 +3964,6 @@ destructor TPythonEngine.Destroy;
39683964
FClients.Free;
39693965
FInitScript.Free;
39703966
FTraceback.Free;
3971-
FLock.Free;
39723967
{$IFNDEF FPC}
39733968
inherited;
39743969
{$ENDIF}
@@ -4039,16 +4034,6 @@ procedure TPythonEngine.Finalize;
40394034
FPyDateTime_DateTimeTZType := nil;
40404035
end;
40414036

4042-
procedure TPythonEngine.Lock;
4043-
begin
4044-
FLock.Enter;
4045-
end;
4046-
4047-
procedure TPythonEngine.Unlock;
4048-
begin
4049-
FLock.Leave;
4050-
end;
4051-
40524037
procedure TPythonEngine.AfterLoad;
40534038
begin
40544039
inherited;

Tests/NumberServicesTest.pas

-6
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,6 @@ constructor PyTRandomInteger.CreateWith(PythonType: TPythonType;
282282
try
283283
inherited;
284284

285-
// obtain lock
286-
Lock;
287-
288285
// create object
289286
FRandomInteger := TRandomInteger.Create;
290287

@@ -294,9 +291,6 @@ constructor PyTRandomInteger.CreateWith(PythonType: TPythonType;
294291
// try to parse
295292
if (PyArg_ParseTuple(args, '|O:CreateWith', @val1) <> 0) and Assigned(val1) then
296293
FRandomInteger.Value := PythonToTRandomInteger(val1).Value;
297-
298-
// unlock
299-
Unlock;
300294
except
301295
on e: Exception do
302296
PyErr_SetString(PyExc_Exception^, PAnsiChar(AnsiString(e.Message)));

0 commit comments

Comments
 (0)