From: Vincent Pit Date: Sun, 8 Feb 2009 18:16:45 +0000 (+0100) Subject: Remove entries from @dl_unload_file when unload succeed instead of undefining them X-Git-Tag: v0.08~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=af894e2502bb03d24c5179d85e7f6705e2fcd9df;p=perl%2Fmodules%2FTest-Valgrind.git Remove entries from @dl_unload_file when unload succeed instead of undefining them --- diff --git a/lib/Test/Valgrind.pm b/lib/Test/Valgrind.pm index d003528..962264b 100644 --- a/lib/Test/Valgrind.pm +++ b/lib/Test/Valgrind.pm @@ -233,10 +233,9 @@ sub import { END { if ($run and eval { require DynaLoader; 1 }) { - for (@DynaLoader::dl_librefs) { - next unless defined; - undef $_ if DynaLoader::dl_unload_file($_); - } + my @rest; + DynaLoader::dl_unload_file($_) and push @rest, $_ for @DynaLoader::dl_librefs; + @DynaLoader::dl_librefs = @rest; } }