more object destruction cleanups
This commit is contained in:
parent
c4204eff89
commit
a1d8dbd67a
4 changed files with 11 additions and 34 deletions
|
|
@ -669,27 +669,6 @@ sub drawExtraHeadTags {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 DESTROY ( )
|
||||
|
||||
Completely remove an asset from existence.
|
||||
|
||||
=cut
|
||||
|
||||
sub DESTROY {
|
||||
my $self = shift;
|
||||
|
||||
# Let the parent be garbage collected if no one else is referencing
|
||||
# him. firstChild and lastChild are weak references, so no need to
|
||||
# worry about them here.
|
||||
delete $self->{_parent};
|
||||
|
||||
$self = undef;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 extraHeadTags ( value )
|
||||
|
|
|
|||
|
|
@ -321,11 +321,10 @@ Extend the base method to delete the locally cached thread object.
|
|||
|
||||
=cut
|
||||
|
||||
override DESTROY => sub {
|
||||
my $self = shift;
|
||||
$self->{_thread}->DESTROY if (exists $self->{_thread} && ref $self->{_thread} =~ /Thread/);
|
||||
super();
|
||||
};
|
||||
sub DEMOLISH {
|
||||
my $self = shift;
|
||||
$self->{_thread}->DESTROY if (exists $self->{_thread} && ref $self->{_thread} =~ /Thread/);
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -238,13 +238,12 @@ and next threads, and to delete the parent CS.
|
|||
|
||||
=cut
|
||||
|
||||
override DESTROY => sub {
|
||||
my $self = shift;
|
||||
return undef unless defined $self;
|
||||
$self->{_next}->DESTROY if (defined $self->{_next});
|
||||
$self->{_previous}->DESTROY if (defined $self->{_previous});
|
||||
super();
|
||||
};
|
||||
sub DEMOLISH {
|
||||
my $self = shift;
|
||||
return undef unless defined $self;
|
||||
$self->{_next}->DESTROY if (defined $self->{_next});
|
||||
$self->{_previous}->DESTROY if (defined $self->{_previous});
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ Destroy the cached assets
|
|||
|
||||
=cut
|
||||
|
||||
sub DESTROY {
|
||||
sub DEMOLISH {
|
||||
my $self = shift;
|
||||
for my $key ( qw/ _nextAlbum _prevAlbum / ) {
|
||||
my $asset = delete $self->{ $key };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue