pyscripter / python4delphi

Free components that wrap up Python into Delphi and Lazarus (FPC)
MIT License
895 stars 307 forks source link

Unfreed memory block #426

Closed kjteng closed 1 year ago

kjteng commented 1 year ago

I noticed that there is always some unfreed memory block reported whenever I have TPythonDelphiVar in my apps. I HV added "finalize" to the destructor (see below) which seems to work. I am not sure whether this is the correct way. Please advise. TQ.

destructor TEngineClient.Destroy; begin Engine := nil; // This detaches the client from the Engine. if Assigned( FOnDestroy ) then FOnDestroy( Self ); Self.finalize; //added by me inherited; end;

pyscripter commented 1 year ago

Probably related to https://github.com/Alexey-T/Python-for-Lazarus/issues/29. I will have a look.

Alexey-T commented 1 year ago

copied the fix to Python4Lazarus.