X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FTest%2FValgrind.pm;h=8809c6544f58ce2630cbcbca503bacfb44498be7;hb=dc74bb8dc22ffd44b893cab2f065948c03410d1a;hp=1ce6a8be274822be562e4107e4caa8f511060871;hpb=e88c20f0a4b0b3c4f2177c1200a9a37d53fbe14a;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/lib/Test/Valgrind.pm b/lib/Test/Valgrind.pm index 1ce6a8b..8809c65 100644 --- a/lib/Test/Valgrind.pm +++ b/lib/Test/Valgrind.pm @@ -139,7 +139,8 @@ sub import { $callers = int $callers; my $vg = Test::Valgrind::Suppressions::VG_PATH; if (!$vg || !-x $vg) { - for (split /:/, $ENV{PATH}) { + require Config; + for (split /$Config::Config{path_sep}/, $ENV{PATH}) { $_ .= '/valgrind'; if (-x) { $vg = $_; @@ -230,6 +231,14 @@ sub import { } } +END { + if ($run and eval { require DynaLoader; 1 }) { + my @rest; + DynaLoader::dl_unload_file($_) and push @rest, $_ for @DynaLoader::dl_librefs; + @DynaLoader::dl_librefs = @rest; + } +} + =head1 CAVEATS You can't use this module to test code given by the C<-e> command-line switch. @@ -256,7 +265,7 @@ L, L, L. Vincent Pit, C<< >>, L. -You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince). +You can contact me by mail or on C (vincent). =head1 BUGS @@ -276,7 +285,7 @@ H.Merijn Brand, for daring to test this thing. =head1 COPYRIGHT & LICENSE -Copyright 2008 Vincent Pit, all rights reserved. +Copyright 2008-2009 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.