[Bast-commits] r3497 - branches/DBIx-Class-current/lib/DBIx/Class/Storage

blblack at dev.catalyst.perl.org blblack at dev.catalyst.perl.org
Thu Jun 14 20:54:14 GMT 2007


Author: blblack
Date: 2007-06-14 20:54:13 +0100 (Thu, 14 Jun 2007)
New Revision: 3497

Modified:
   branches/DBIx-Class-current/lib/DBIx/Class/Storage/DBI.pm
Log:
weaken the storage reference in the HandleError closure!

Modified: branches/DBIx-Class-current/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- branches/DBIx-Class-current/lib/DBIx/Class/Storage/DBI.pm	2007-06-13 05:31:39 UTC (rev 3496)
+++ branches/DBIx-Class-current/lib/DBIx/Class/Storage/DBI.pm	2007-06-14 19:54:13 UTC (rev 3497)
@@ -10,7 +10,7 @@
 use DBIx::Class::Storage::DBI::Cursor;
 use DBIx::Class::Storage::Statistics;
 use IO::File;
-use Scalar::Util 'blessed';
+use Scalar::Util qw/blessed weaken/;
 
 __PACKAGE__->mk_group_accessors('simple' =>
     qw/_connect_info _dbi_connect_info _dbh _sql_maker _sql_maker_opts
@@ -768,8 +768,10 @@
     }
 
     if(!$self->unsafe) {
+      my $weak_self = $self;
+      weaken($weak_self);
       $dbh->{HandleError} = sub {
-          $self->throw_exception("DBI Exception: $_[0]")
+          $weak_self->throw_exception("DBI Exception: $_[0]")
       };
       $dbh->{RaiseError} = 1;
       $dbh->{PrintError} = 0;




More information about the Bast-commits mailing list