Bug 894405 - fix leaks on a CLOSED TREE

--HG--
extra : rebase_source : d96236c0c9c370bdb055d3ab197707d48f8afe80