Commit 503a314b authored by Lisandro Dalcin's avatar Lisandro Dalcin

GIL state needs to be released after finishing refnanny contexts

parent 28385b16
......@@ -1181,8 +1181,7 @@ class FuncDefNode(StatNode, BlockNode):
for entry in lenv.arg_entries:
if entry.type.is_pyobject and lenv.control_flow.get_state((entry.name, 'source')) != 'arg':
code.put_var_decref(entry)
if acquire_gil:
code.putln("PyGILState_Release(_save);")
# code.putln("/* TODO: decref scope object */")
# ----- Return
# This code is duplicated in ModuleNode.generate_module_init_func
......@@ -1199,6 +1198,9 @@ class FuncDefNode(StatNode, BlockNode):
Naming.retval_cname,
err_val)
if acquire_gil:
code.putln("PyGILState_Release(_save);")
if not self.return_type.is_void:
code.putln("return %s;" % Naming.retval_cname)
......
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