]> git.vpit.fr Git - perl/modules/Test-Valgrind.git/blobdiff - lib/Test/Valgrind.pm
Don't call dl_unload_file twice on the same libref
[perl/modules/Test-Valgrind.git] / lib / Test / Valgrind.pm
index 31a63234601267e148152ffd4f031ee85f68af74..d003528be0d3158d2efc541426d7547aa5d05f87 100644 (file)
@@ -231,6 +231,15 @@ sub import {
  }
 }
 
+END {
+ if ($run and eval { require DynaLoader; 1 }) {
+  for (@DynaLoader::dl_librefs) {
+   next unless defined;
+   undef $_ if DynaLoader::dl_unload_file($_);
+  }
+ }
+}
+
 =head1 CAVEATS
 
 You can't use this module to test code given by the C<-e> command-line switch.