Skip to content

Commit cd737d7

Browse files
committedApr 1, 2020
revert changes to DoOpenDll, OpenDll, LoadDll funcs
1 parent 8dc4168 commit cd737d7

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed
 

‎demos_lazarus/Demo01/project1.res

-134 KB
Binary file not shown.

‎python4lazarus/Sources/Core/PythonEngine.pas

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3341,14 +3341,19 @@ procedure TPythonInputOutput.UpdateCurrentThreadLine;
33413341
(*******************************************************)
33423342

33433343
procedure TDynamicDll.DoOpenDll(const aDllName : String);
3344+
var
3345+
S: String;
33443346
begin
33453347
if not IsHandleValid then
33463348
begin
3349+
FDllName := aDllName;
3350+
S := GetDllPath+DllName;
3351+
33473352
{$ifdef windows}
3348-
FDLLHandle := Windows.LoadLibrary(PChar(aDllName));
3353+
FDLLHandle := Windows.LoadLibrary(PChar(S));
33493354
{$else}
33503355
//Linux: need here RTLD_GLOBAL, so Python can do "import ctypes"
3351-
FDLLHandle := PtrInt(dlopen(PAnsiChar(aDllName), RTLD_LAZY+RTLD_GLOBAL));
3356+
FDLLHandle := PtrInt(dlopen(PAnsiChar(S), RTLD_LAZY+RTLD_GLOBAL));
33523357
{$endif}
33533358
end;
33543359
end;
@@ -3389,7 +3394,7 @@ procedure TDynamicDll.OpenDll(const aDllName : String);
33893394

33903395
if not IsHandleValid then begin
33913396
{$IFDEF windows}
3392-
s := Format('Error %d: Could not open Dll "%s"',[GetLastError, aDllName]);
3397+
s := Format('Error %d: Could not open Dll "%s"',[GetLastError, DllName]);
33933398
{$else}
33943399
s := Format('Error: Could not open Dll "%s"',[DllName]);
33953400
{$ENDIF}
@@ -3454,7 +3459,7 @@ function TDynamicDll.IsHandleValid : Boolean;
34543459

34553460
procedure TDynamicDll.LoadDll;
34563461
begin
3457-
OpenDll(DllPath + DllName);
3462+
OpenDll( DllName );
34583463
end;
34593464

34603465
procedure TDynamicDll.UnloadDll;

0 commit comments

Comments
 (0)
Please sign in to comment.