Commit 7ab811ce authored by Stefan Behnel's avatar Stefan Behnel

fix reference leak

parent afa7d68a
...@@ -4830,7 +4830,7 @@ class PyMethodCallNode(SimpleCallNode): ...@@ -4830,7 +4830,7 @@ class PyMethodCallNode(SimpleCallNode):
self.function.generate_disposal_code(code) self.function.generate_disposal_code(code)
self.function.free_temps(code) self.function.free_temps(code)
self_arg = code.funcstate.allocate_temp(py_object_type, manage_ref=bool(args)) self_arg = code.funcstate.allocate_temp(py_object_type, manage_ref=True)
code.putln("%s = NULL;" % self_arg) code.putln("%s = NULL;" % self_arg)
arg_offset_cname = None arg_offset_cname = None
if len(args) > 1: if len(args) > 1:
...@@ -4862,7 +4862,8 @@ class PyMethodCallNode(SimpleCallNode): ...@@ -4862,7 +4862,8 @@ class PyMethodCallNode(SimpleCallNode):
self.result(), self.result(),
function, self_arg, function, self_arg,
code.error_goto_if_null(self.result(), self.pos))) code.error_goto_if_null(self.result(), self.pos)))
code.funcstate.release_temp(self_arg) # borrowed ref in this case code.put_decref_clear(self_arg, py_object_type)
code.funcstate.release_temp(self_arg)
code.putln("} else {") code.putln("} else {")
code.globalstate.use_utility_code( code.globalstate.use_utility_code(
UtilityCode.load_cached("PyObjectCallNoArg", "ObjectHandling.c")) UtilityCode.load_cached("PyObjectCallNoArg", "ObjectHandling.c"))
......
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