etiennedub / pyk4a

Python 3 wrapper for Azure-Kinect-Sensor-SDK
MIT License
287 stars 81 forks source link

Adding Py_INCREF(Py_None); #201

Closed TMFJT closed 1 year ago

TMFJT commented 1 year ago

In this branch, I made one change by adding Py_INCREF(Py_None) before returning Py_None. This is important to ensure correct counting of references for Py_None.

If Py_INCREF(Py_None) is not added, returning too many None values may cause the following error: Fatal Python error: none_dealloc: deallocating None Python runtime state: initialized

Therefore, it is necessary to add Py_INCREF(Py_None) before returning Py_None to prevent this error.

lpasselin commented 1 year ago

Nice, thanks for submitting this fix. We'll have to also fix the dev branch.