##// END OF EJS Templates
localrepo: don't reference transaction from hook closure (issue5043)...
Gregory Szorc -
r27907:e219dbfd default
parent child Browse files
Show More
@@ -1085,9 +1085,15 b' class localrepository(object):'
1085 1085 def txnclosehook(tr2):
1086 1086 """To be run if transaction is successful, will schedule a hook run
1087 1087 """
1088 # Don't reference tr2 in hook() so we don't hold a reference.
1089 # This reduces memory consumption when there are multiple
1090 # transactions per lock. This can likely go away if issue5045
1091 # fixes the function accumulation.
1092 hookargs = tr2.hookargs
1093
1088 1094 def hook():
1089 1095 reporef().hook('txnclose', throw=False, txnname=desc,
1090 **tr2.hookargs)
1096 **hookargs)
1091 1097 reporef()._afterlock(hook)
1092 1098 tr.addfinalize('txnclose-hook', txnclosehook)
1093 1099 def txnaborthook(tr2):
General Comments 0
You need to be logged in to leave comments. Login now