Closed Vobsoft closed 3 months ago
The refcount of result needs to be incremented.
ExtractPythonObjectFrom does not increment the result, so you need to do it as in your second routine.
In your third routine PyObject_GetAttrString returns a new reference so you are also OK.
Hi, If I edit Demo05
Will throw an error when repeatedly calling Foo Project Demo05.exe raised exception class $C0000005 with message 'access violation at 0x79530e00: read of address 0x79530e00'. If I add Py_IncRef(result); it's OK
This is also OK
Is this a bug or just my inexperience? Delphi 11, Python Dll: 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 21:47:43) [MSC v.1937 32 bit (Intel)]