You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2006/07/10 02:22:16 UTC
svn commit: r420378 - in /spamassassin/branches/3.1/lib/Mail:
SpamAssassin.pm SpamAssassin/Bayes.pm
Author: felicity
Date: Sun Jul 9 17:22:15 2006
New Revision: 420378
URL: http://svn.apache.org/viewvc?rev=420378&view=rev
Log:
bug 4488: deal with potential memory leak via M::SA::finish() due to circular reference between Bayes and BayesStore objects.
Modified:
spamassassin/branches/3.1/lib/Mail/SpamAssassin.pm
spamassassin/branches/3.1/lib/Mail/SpamAssassin/Bayes.pm
Modified: spamassassin/branches/3.1/lib/Mail/SpamAssassin.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.1/lib/Mail/SpamAssassin.pm?rev=420378&r1=420377&r2=420378&view=diff
==============================================================================
--- spamassassin/branches/3.1/lib/Mail/SpamAssassin.pm (original)
+++ spamassassin/branches/3.1/lib/Mail/SpamAssassin.pm Sun Jul 9 17:22:15 2006
@@ -561,7 +561,7 @@
sub finish_learner {
my $self = shift;
- $self->{bayes_scanner}->finish();
+ $self->{bayes_scanner}->sanity_check_is_untied(1);
1;
}
Modified: spamassassin/branches/3.1/lib/Mail/SpamAssassin/Bayes.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.1/lib/Mail/SpamAssassin/Bayes.pm?rev=420378&r1=420377&r2=420378&view=diff
==============================================================================
--- spamassassin/branches/3.1/lib/Mail/SpamAssassin/Bayes.pm (original)
+++ spamassassin/branches/3.1/lib/Mail/SpamAssassin/Bayes.pm Sun Jul 9 17:22:15 2006
@@ -262,6 +262,7 @@
# use Carp qw(cluck); cluck "stack trace at untie";
$self->{store}->untie_db();
+ delete $self->{store};
}
sub sa_die { Mail::SpamAssassin::sa_die(@_); }
@@ -270,12 +271,13 @@
sub sanity_check_is_untied {
my $self = shift;
+ my $quiet = shift;
# do a sanity check here. Wierd things happen if we remain tied
# after compiling; for example, spamd will never see that the
# number of messages has reached the bayes-scanning threshold.
if ($self->{store}->db_readable()) {
- warn "bayes: oops! still tied to bayes DBs, untying\n";
+ warn "bayes: oops! still tied to bayes DBs, untying\n" unless $quiet;
$self->{store}->untie_db();
}
}