Commit efdf3160 authored by gsamain's avatar gsamain

Avoid unlocking never-locked objects at the end of functions

parent 3086df3a
......@@ -2187,7 +2187,8 @@ class FuncDefNode(StatNode, BlockNode):
code.put_cyxdecref(entry.cname)
for node in lenv.autolocked_nodes:
code.putln("Cy_UNLOCK(%s);" % node.result())
if node.entry.needs_rlock or node.entry.needs_wlock:
code.putln("Cy_UNLOCK(%s);" % node.result())
# Decref any increfed args
for entry in lenv.arg_entries:
......
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