Skip to content

Commit

Permalink
Item14237: 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.
  • Loading branch information
vrurg committed Dec 3, 2016
1 parent 07961d2 commit cbaaf0b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions core/lib/Foswiki/App.pm
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,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 @@ -430,8 +431,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 cbaaf0b

Please sign in to comment.