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

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