-
After running a python script, P4D causes an AV error during program shutdown in the following routine... It seems to be referring to one of my objects as if it support interfaces, which it doesn't. The object has not been wrapped, so there is nothing to free, it is an internal object created in my app and the properties/methods exposed using the RegisterDelphiWrapper function. In wrapDelphi unit
In my Python setup I define
Where tests holds and maintains a list of Ttest created in the program by the user. and the Python code...
The first print works and creates no error when the program is closed. If I unhash the commented out line, it works the same, but the error occurs on program shutdown. I have currently worked around this by by wrapping the P4D line that causes the error with a try/except
Which allows the program to shutdown properly but a bit annoying when running under debugging. is there a way to stop this function being called on shutdown when they shouldn't be ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Could you please post a Delphi project that reproduces the error? |
Beta Was this translation helpful? Give feedback.
-
Hi, I'll try and create a standalone simple project that reproduces the error. Strangely, I have found that adding more python lines of code stops the error from occurring, it only seems to happen on the first access to a delphi object and providing no other accesses are made. |
Beta Was this translation helpful? Give feedback.
-
Hi, took me a long time to track this down, but it appears to be a problem with Synedit rather than P4D. It was a weird one, having between 70 and 81 characters in the editor caused the problem on shutdown. I didn't even need to run any python code and it still did it, it must be a memory corruption caused by the editor. It seems the version of SynEdit I had dated back to 2014, I have upgraded to the latest and the problem has gone away. |
Beta Was this translation helpful? Give feedback.
Hi, took me a long time to track this down, but it appears to be a problem with Synedit rather than P4D.
It was a weird one, having between 70 and 81 characters in the editor caused the problem on shutdown.
I didn't even need to run any python code and it still did it, it must be a memory corruption caused by the editor.
It seems the version of SynEdit I had dated back to 2014, I have upgraded to the latest and the problem has gone away.