]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind.pm
Remove entries from @dl_unload_file when unload succeed instead of undefining them
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind.pm
index 1ce6a8be274822be562e4107e4caa8f511060871..962264b2928dedcf4b4ddd35426d1633100c84d3 100644 (file)
@@ -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<Devel::Leak>, L<Devel::LeakTrace>, L<Devel::LeakTrace::Fast>.
 
 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
 
-You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).
+You can contact me by mail or on C<irc.perl.org> (vincent).
 
 =head1 BUGS