From 1c2009764f6639362f966011f874ab83568fbf1c Mon Sep 17 00:00:00 2001 From: Matt Sergeant Date: Sat, 31 Dec 2005 14:53:50 +0000 Subject: [PATCH] Don't trap $self in the closure (causes circular refs and never gets freed) git-svn-id: https://svn.perl.org/qpsmtpd/trunk@596 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Danga/DNS/Resolver.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Danga/DNS/Resolver.pm b/lib/Danga/DNS/Resolver.pm index 100e234..458fe36 100644 --- a/lib/Danga/DNS/Resolver.pm +++ b/lib/Danga/DNS/Resolver.pm @@ -76,8 +76,9 @@ sub _query { if (exists($self->{cache}{$type}{$host}) && $self->{cache_timeout}{$type}{$host} >= $now) { # print "CACHE HIT!\n"; + my $result = $self->{cache}{$type}{$host}; $self->AddTimer(0, sub { - $asker->run_callback($self->{cache}{$type}{$host}, $host); + $asker->run_callback($result, $host); }); return 1; }