Fix python crash due to missing Py_None reference counting increase#3851
Fix python crash due to missing Py_None reference counting increase#3851andypugh merged 1 commit intoLinuxCNC:masterfrom
Conversation
|
I can't even pretend to understand this bug, or the fix. But thanks. |
Quite simple... I introduced the bug when fixing cppcheck errors a long while ago. Background, every object in python has a reference count. When you get an object, you increase its reference count (informing that the object is in use). When you no longer need it, you decrease the count. Once the count reaches zero, python will automatically discard the object and free the memory. This is true for all objects, including the Halmodule had originally return statements using |
This fixes #3850 by adding reference count increase before returning Py_None.