Toss more {} blocks around your code to create more scopes. An object's DESTROY isn't called when the ref scalar holding it reassigned, but when scope is left. Create an debugging object that prints to console when its DESTROY() and use a step through debugger. I didn't run your code.
Is your memory leak reproduced in the code you posted or the code you posted just shows how *you* know its a memory leak?