Subject: | Fix for #13660 |
Date: | Mon, 15 Mar 2010 17:32:33 -0700 |
To: | bug-IPC-Run [...] rt.cpan.org |
From: | Pavel Georgiev <pavel.l.georgiev [...] gmail.com> |
Hello,
I hit an old issue: http://rt.cpan.org/Public/Bug/Display.html?id=13660 and I've been digging into IPC::Run. I noticed that _new_internal() inside IO.pm creates circular references which lead to the observed leak. Such references are created on line 163, 182, 186, 204, 206, 210, 212, the closures that are pushed to $self{FILTERS} contain references to $self, so that the reference count on $self does never go to 0 and it is never freed.
I'm attaching a patch that sets $self{FILTERS} to undef in _cleanup inside IO.pm, so that the object can be destroyed by the garbage collector. That works for me and the test code inside the bug report no longer leaks.
Hope that helps and makes it into the main release,
Pavel
Message body is not shown because sender requested not to inline it.