Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix leak in
object_to_double_
. (#3235)
The fact: * `nrnpy_ho2po` seems to return a "new reference". * `PyFloat_AsDouble` doesn't steal [1]. Therefore, the previous version had: * A local reference count of `+1` after `ho2po`. * A local reference count of `+2` after `INCREF`. * The `PyFloat_AsDouble` doesn't change the reference count. * A local reference count of `+1` after `DECREF`. Leaving one INCREF that we can't pair up with a DECREF. The proposed version immediately takes ownership of the new reference returned by `nrnpy_ho2po`. [1]: https://docs.python.org/3/c-api/float.html#c.PyFloat_AsDouble
- Loading branch information