Fix rogue child disconnecting a parent $dbh - no idea how I even missed that
Peter Rabbitson [Fri, 17 Feb 2012 11:54:09 +0000 (12:54 +0100)]
Changes
lib/DBIx/Class/Storage/DBI.pm
t/storage/global_destruction.t

diff --git a/Changes b/Changes
index 85dc399..1e3dfbd 100644 (file)
--- a/Changes
+++ b/Changes
@@ -11,6 +11,8 @@ Revision history for DBIx::Class
           instead
         - Fix SkipFirst and FirstSkip limit dialects (Informix and Firebird)
         - A number of corner case fixes of void context populate() with \[]
+        - Fix corner case of forked children disconnecting the parents DBI
+          handle
 
     * Misc
         - Codebase is now trailing-whitespace-free
index 8abcc6e..7041e9d 100644 (file)
@@ -230,6 +230,7 @@ sub DESTROY {
   my $self = shift;
 
   # some databases spew warnings on implicit disconnect
+  $self->_verify_pid;
   local $SIG{__WARN__} = sub {};
   $self->_dbh(undef);
 
index e92a3a6..ae4260a 100644 (file)
@@ -53,6 +53,7 @@ for my $type (qw/PG MYSQL/) {
           }
           else {
             note "Child $$ terminating";
+            undef $DBICTest::FakeSchemaFactory::schema;
             exit 0;
           }