pyscripter / python4delphi

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

Pagecontrol.ActivePage wrapper function causes AV error #447

Closed Andyk1234 closed 7 months ago

Andyk1234 commented 7 months ago

Noticed problem in Demo31 project as the "Go to Page 3" button produces an AV error.

Problem appears in WrapVclComCtrls unit

function TPyDelphiPageControl.Get_ActivePage(AContext: Pointer): PPyObject; begin Result := Wrap(DelphiObject.ActivePage); end;

DelphiObject has a nil value;

If fixed it by adding line

Adjust(@Self); to the start of the function.

There are several functions in the unit that don't setup DelphiObject before calls to Wrap, I suspect they will all produce AV errors.

pyscripter commented 7 months ago

Clearly you are not using the latest version of this repo. This was fixed almost a year ago in https://github.com/pyscripter/python4delphi/commit/824cf1e0c1857734fd3ae971d93f318ee8f2a1d6.

Andyk1234 commented 7 months ago

I downloaded the repo zip file 3 days ago.

pyscripter commented 7 months ago

From which repo? Here the issue is fixed. Check for yourself. Browse the file or see https://github.com/pyscripter/python4delphi/commit/824cf1e0c1857734fd3ae971d93f318ee8f2a1d6.

Andyk1234 commented 7 months ago

I am not sure what you mean by "which Repo",

I hit the code tag at the top left of this page then select the Green code button to the top right, then select "Download Zip"

pyscripter commented 7 months ago

Repo stands for repository. Did you download your zip file from https://github.com/pyscripter/python4delphi or say the Embarcadero fork?

I believe you are not using the latest files from https://github.com/pyscripter/python4delphi since here the issue has been fixed a long time ago.

Andyk1234 commented 7 months ago

I downloaded from these pages, I don't see any other forks.

I have downloaded it again, I can see the fixes now, odd.

Although demo 11 still doesn't work.

pyscripter commented 7 months ago

It was working on 32 bits. It is now fixed for 64 bits. Please download again.

Andyk1234 commented 7 months ago

Yep, works now.

Thank you.