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 ( )

View file

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

View file

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