From: Peter Rabbitson Date: Fri, 17 Feb 2012 11:54:09 +0000 (+0100) Subject: Fix rogue child disconnecting a parent $dbh - no idea how I even missed that X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66441708b7337cde35fa7f618e23df0c155cd741;p=dbsrgits%2FDBIx-Class-Historic.git Fix rogue child disconnecting a parent $dbh - no idea how I even missed that --- diff --git a/Changes b/Changes index 85dc399..1e3dfbd 100644 --- 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 diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 8abcc6e..7041e9d 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -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); diff --git a/t/storage/global_destruction.t b/t/storage/global_destruction.t index e92a3a6..ae4260a 100644 --- a/t/storage/global_destruction.t +++ b/t/storage/global_destruction.t @@ -53,6 +53,7 @@ for my $type (qw/PG MYSQL/) { } else { note "Child $$ terminating"; + undef $DBICTest::FakeSchemaFactory::schema; exit 0; }