Skip to content

Commit

Permalink
A new Slash::DB can't be created someplace where it will go out of scope
Browse files Browse the repository at this point in the history
before the installation process is complete.  Since we're using
connect_cached, the Slash::DB object actually gets the same DBH as the
Slash::Install object itself, and when it goes out of scope both DBHs
get disconnected.  So, it's now an instance variable that persists for
the life of the Slash::Install object.
  • Loading branch information
jamiemccarthy committed Mar 2, 2001
1 parent 36ce0b9 commit df5d41b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Slash/Install/Install.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ sub new {
bless ($self,$class);
$self->{virtual_user} = $user;
$self->sqlConnect;
$self->{slashdb} = Slash::DB->new($user);

return $self;
}
Expand Down Expand Up @@ -207,10 +208,9 @@ sub _install {
}

if($plugin->{'template'}) {
my $slash = Slash::DB->new($self->{virtual_user});
for(@{$plugin->{'template'}}) {
my $template = $self->readTemplateFile("$plugin->{'dir'}/$_");
$slash->createTemplate($template) if $template;
$self->{slashdb}->createTemplate($template) if $template;
}
}
if ($plugin->{note}) {
Expand Down

0 comments on commit df5d41b

Please sign in to comment.