Commit abb6ce68 authored by Leigh Stoller's avatar Leigh Stoller

Deal with circular dependency that was causing the aptevent daemon

to grow and grow and grow, until Mike notices.
parent 8905ab2e
......@@ -202,13 +202,23 @@ sub Flush($)
{
my ($self) = @_;
delete($instances{$self->uuid()});
}
#
# We use this in long running daemons, since we have a circular dependency
# that causes the perl GC to leak memory. Normally not a problem, but the
# aptevent_daemon runs for a long time!
#
sub Purge($)
{
my ($self) = @_;
#
# Break circular dependency so that the object is released
# (the aggregate object points back to the instance).
# (the aggregate objects point back to the instance).
#
#$self->{'AGGREGATES'} = undef;
delete($instances{$self->uuid()});
$self->{'AGGREGATES'} = undef;
$self->Flush();
}
#
......
......@@ -182,7 +182,7 @@ sub callback($$$)
goto done;
}
done:
$instance->Flush();
$instance->Purge();
}
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment