Commit b0aaba60 authored by Stefan Behnel's avatar Stefan Behnel

Always call the refnanny on function exit if we set it up on entry, not just...

Always call the refnanny on function exit if we set it up on entry, not just in GIL-owning functions.
This was previously using inconsistent conditions on entry and exit of the function.
parent 719c98bd
......@@ -2175,8 +2175,7 @@ class FuncDefNode(StatNode, BlockNode):
code.put_trace_return(
"Py_None", nogil=not gil_owned['success'])
if not lenv.nogil:
# GIL holding function
if use_refnanny:
code.put_finish_refcount_context(nogil=not gil_owned['success'])
if acquire_gil or (lenv.nogil and gil_owned['success']):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment