yethum / python4delphi

Automatically exported from code.google.com/p/python4delphi
0 stars 0 forks source link

Only finalize the TPythonEngine after remove all clients #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Programmatically setup a TPythonEngine instance.
2. Programmatically create modules (clients).
3. Each module creation/destruction generates a new TPythonEngine instance.

What is the expected output? What do you see instead?
The issue consists that for each module creation/destruction a new 
TPythonEngine is created, taking time on loading the python dll.
I want share the same TPythonEngine across multiple modules 
creation/destruction. 

What version of the product are you using? On what operating system?
Trunk clone.

Please provide any additional information below.
I'm using P4D to access a template engine (Jinja2) from Delphi, to render out 
our reports.

I'm sharing the source code that fix this issue.

Tks in advance.

Original issue reported on code.google.com by fgmac...@gmail.com on 23 May 2011 at 8:31

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by pyscripter on 5 Dec 2011 at 12:21