Fix leaking attributes in java PyObject.#539
Conversation
|
Wait, it seems necessary to check that if (pyAttr) {
Py_DECREF(pyAttr);
}or Py_XDECREF(pyAttr); |
jobject_as_PyObject() only returns null when the python exception is set so the check for process_py_exception() ensures that |
Ok, so |
Anytime the python exception is set from jobject_as_PyObject() it will return null so in the case it does not hit the new DECREF it will be null and does not need a DECREF. |
|
Okay, I'm not very familiar with Python's C interface. I was just considering whether we need to maintain consistency with the rest of the code, such as |
It looks to me like |
|
I agree the |
|
I finally had some time to look at this closely. I added a test to see if equals is leaking and found it is not leaking, I just didn't notice the |
|
Good catch. I'm good with this going in. |
This is a fix for the problem identified in #538.