Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Loading and Unloading Python DLLs#434

Unanswered
ianmackers asked this question inQ&A
Discussion options

I am writing a python script manager that needs to load/unload different python DLLs and virtual environments.

Doing a simple thing like PythonEngine.LoadDLL, UnloadDLL and then again LoadDLL gives me the "'There is already one instance of TPythonEngine running".

The only way I can get this to work is to add the "gPythonEngine := nil" line below into the following procuedure:

procedure TDynamicDll.UnloadDll;
begin
if IsHandleValid then begin
BeforeUnload;
FreeLibrary(FDLLHandle);
FDLLHandle := 0;
gPythonEngine := nil --> Added this line
end;
end;

IS this a bug or am I going about the process incorrectly?

Thanks

You must be logged in to vote

Replies: 1 comment

Comment options

See Demo34,#287 andhttps://en.delphipraxis.net/topic/7721-if-i-changed-the-p4d-dllpath-how-to-reload-dlls

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@ianmackers@pyscripter

[8]ページ先頭

©2009-2025 Movatter.jp