Skip to content

Commit

Permalink
Item13897: Don't attempt to finalize login manager in global destruct…
Browse files Browse the repository at this point in the history
…ion.

It often results in unitialized attributes being accessed.

(cherry picked from commit cbaaf0b)
  • Loading branch information
vrurg committed Dec 3, 2016
1 parent c888484 commit eb65efc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions core/lib/Foswiki/App.pm
Expand Up @@ -98,9 +98,10 @@ instance.
=cut

has cfg => (
is => 'rw',
lazy => 1,
builder => '_prepareConfig',
is => 'rw',
lazy => 1,
predicate => 1,
builder => '_prepareConfig',
isa => Foswiki::Object::isaCLASS( 'cfg', 'Foswiki::Config', noUndef => 1, ),
);
has env => (
Expand Down Expand Up @@ -421,8 +422,13 @@ sub DEMOLISH {

# Make sure not to do this if incomplete initialization happened or we're
# doomed for "(in cleanup)" messages.
# Skip it over global destruction stage too.
$this->users->loginManager->complete
if $this->users && $this->users->has_loginManager;
if !$in_global
&& $this->has_users
&& $this->users
&& $this->users->has_loginManager
&& $this->users->loginManager;
}

=begin TML
Expand Down

0 comments on commit eb65efc

Please sign in to comment.