]> 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 31a63234601267e148152ffd4f031ee85f68af74..962264b2928dedcf4b4ddd35426d1633100c84d3 100644 (file)
@@ -231,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.