adding deconstructors

This commit is contained in:
JT Smith 2006-01-13 17:53:53 +00:00
parent 20d259dd0d
commit 970eeb048a
3 changed files with 46 additions and 5 deletions

View file

@ -274,6 +274,21 @@ sub deleteRow {
} }
#-------------------------------------------------------------------
=head DESTROY ( )
Deconstructor.
=cut
sub DESTROY {
my $self = shift;
$self->disconnect;
undef $self;
}
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head2 disconnect ( ) =head2 disconnect ( )

View file

@ -99,12 +99,10 @@ Cleans up a WebGUI session information from memory and disconnects from any reso
sub close { sub close {
my $self = shift; my $self = shift;
$self->asset->DESTROY() if (exists $self->asset && $self->asset ne ""); foreach my $object (keys %{$self}) {
foreach my $slavedbh (@{$self->{_slave}}) { $self->{$object}->DESTROY;
$slavedbh->disconnect();
} }
$self->{_db}->disconnect if (exists $self->{_db}); undef $self;
undef %session;
} }
#------------------------------------------------------------------- #-------------------------------------------------------------------
@ -179,6 +177,20 @@ sub dbSlave {
} }
#-------------------------------------------------------------------
=head DESTROY ( )
Deconstructor.
=cut
sub DESTROY {
my $self = shift;
$self->close;
}
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head2 env ( ) =head2 env ( )

View file

@ -173,6 +173,20 @@ sub deleteFromGroups {
$group->deleteUsers([$self->userId],$groups); $group->deleteUsers([$self->userId],$groups);
} }
#-------------------------------------------------------------------
=head DESTROY ( )
Deconstructor.
=cut
sub DESTROY {
my $self = shift;
undef $self;
}
#------------------------------------------------------------------- #-------------------------------------------------------------------
=head2 getGroups ( [ withoutExpired ] ) =head2 getGroups ( [ withoutExpired ] )