You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2022/04/20 05:54:52 UTC
svn commit: r1900060 - /spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
Author: hege
Date: Wed Apr 20 05:54:52 2022
New Revision: 1900060
URL: http://svn.apache.org/viewvc?rev=1900060&view=rev
Log:
Bug 7973 - PerMsgStatus.pm: sub finish_tests never called
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm?rev=1900060&r1=1900059&r2=1900060&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm Wed Apr 20 05:54:52 2022
@@ -68,10 +68,10 @@ use Mail::SpamAssassin::Logger;
our @ISA = qw();
-# methods defined by the compiled ruleset; deleted in finish_tests()
+# methods defined by the compiled ruleset; deleted in finish()
our @TEMPORARY_METHODS;
-# methods defined by register_plugin_eval_glue(); deleted in finish_tests()
+# methods defined by register_plugin_eval_glue(); deleted in finish()
our %TEMPORARY_EVAL_GLUE_METHODS;
###########################################################################
@@ -1947,16 +1947,9 @@ sub finish {
permsgstatus => $self
});
- $self->report_unsatisfied_actions;
+ $self->report_unsatisfied_actions();
- # Delete out all of the members of $self. This will remove any direct
- # circular references and let the memory get reclaimed while also being more
- # efficient than a foreach() loop over the keys.
- %{$self} = ();
-}
-
-sub finish_tests {
- my ($conf) = @_;
+ # Clean up temporary methods
foreach my $method (@TEMPORARY_METHODS) {
if (defined &{$method}) {
undef &{$method};
@@ -1964,8 +1957,17 @@ sub finish_tests {
}
@TEMPORARY_METHODS = (); # clear for next time
%TEMPORARY_EVAL_GLUE_METHODS = ();
+
+ # Delete out all of the members of $self. This will remove any direct
+ # circular references and let the memory get reclaimed while also being more
+ # efficient than a foreach() loop over the keys.
+ %{$self} = ();
}
+# Deprecated for clarity, only Plugins have this function
+sub finish_tests {}
+
+###########################################################################
=item $name = $status->get_current_eval_rule_name()
@@ -2963,11 +2965,11 @@ ENDOFEVAL
eval $evalstr . '; 1' ## no critic
or do {
my $eval_stat = $@ ne '' ? $@ : "errno=$!"; chomp $eval_stat;
- warn "rules: failed to run header tests, skipping some: $eval_stat\n";
+ warn "rules: failed to compile method '$function': $eval_stat\n";
$self->{rule_errors}++;
};
- # ensure this method is deleted if finish_tests() is called
+ # ensure this method is deleted if finish() is called
push (@TEMPORARY_METHODS, $function);
}