From: Peter Rabbitson Date: Sat, 25 Jan 2014 07:06:39 +0000 (+0100) Subject: One extra cleanup pass before asserting weakregistry is empty X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=de4705b7393350ae7cde8f5409f204747c1a4a4e;p=dbsrgits%2FDBIx-Class-Historic.git One extra cleanup pass before asserting weakregistry is empty --- diff --git a/t/lib/DBICTest/Util/LeakTracer.pm b/t/lib/DBICTest/Util/LeakTracer.pm index b3984b6..58790e4 100644 --- a/t/lib/DBICTest/Util/LeakTracer.pm +++ b/t/lib/DBICTest/Util/LeakTracer.pm @@ -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 }