[poe-commits] SF.net SVN: poe: [2021] trunk/poe/lib/POE/Filter/Reference.pm
Brought to you by:
rcaputo
From: <rc...@us...> - 2006-08-06 21:52:34
|
Revision: 2021 Author: rcaputo Date: 2006-08-06 14:52:23 -0700 (Sun, 06 Aug 2006) ViewCVS: http://svn.sourceforge.net/poe/?rev=2021&view=rev Log Message: ----------- Stop deleting the freezer module's path from from %INC. While this does prompt Perl to fully reload the module, it also introduces a bad memory leak when POE::Filter::Reference->new() is called with a package name. Given the choice between both bad outcomes, I'll prefer the noisy one to the silent but deadly one. This resolvels rt.cpan.org ticket 18982, reported by Allen Donovan. Modified Paths: -------------- trunk/poe/lib/POE/Filter/Reference.pm Modified: trunk/poe/lib/POE/Filter/Reference.pm =================================================================== --- trunk/poe/lib/POE/Filter/Reference.pm 2006-08-06 20:55:42 UTC (rev 2020) +++ trunk/poe/lib/POE/Filter/Reference.pm 2006-08-06 21:52:23 UTC (rev 2021) @@ -99,16 +99,15 @@ } else { # A package name? - my $package = $freezer; + my $path = $freezer; + $path =~ s{::}{/}g; - $package =~ s(::)(\/)g; - delete $INC{$package . ".pm"}; - eval { - local $^W=0; - require "$package.pm"; - import $freezer (); + local $^W = 0; + require "$path.pm"; + $freezer->import(); }; + carp $@ if $@; ($freeze, $thaw) = _get_methods($freezer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |