From: Lisandro Dalcin Date: Tue, 3 Feb 2009 17:39:04 +0000 (-0200) Subject: GIL state needs to be released after finishing refnanny contexts X-Git-Tag: 0.11.rc~93^2~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=503a314b6301e4362bcd573700d1cde6cefb4bc9;p=cython.git GIL state needs to be released after finishing refnanny contexts --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 7664e0de..0002cb21 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -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)