One extra cleanup pass before asserting weakregistry is empty
Peter Rabbitson [Sat, 25 Jan 2014 07:06:39 +0000 (08:06 +0100)]
t/lib/DBICTest/Util/LeakTracer.pm

index b3984b6..58790e4 100644 (file)
@@ -166,6 +166,9 @@ sub assert_empty_weakregistry {
 
   croak 'Expecting a registry hashref' unless ref $weak_registry eq 'HASH';
 
+  defined $weak_registry->{$_}{weakref} or delete $weak_registry->{$_}
+    for keys %$weak_registry;
+
   return unless keys %$weak_registry;
 
   my $tb = eval { Test::Builder->new }