From: Peter Rabbitson Date: Fri, 26 Nov 2010 13:15:55 +0000 (+0100) Subject: Fix the DBI-destroy-warning silencer X-Git-Tag: v0.08125~40 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=8e9b9ce5f997bb8f90a56ecfee9b96b0f5b6ff9d Fix the DBI-destroy-warning silencer --- diff --git a/Changes b/Changes index a38c256..95b2dde 100644 --- a/Changes +++ b/Changes @@ -27,6 +27,7 @@ Revision history for DBIx::Class - Improve "fork()" on Win32 by reimplementing a more robust DBIC thread support (still problematic, pending a DBI fix) - Properly quote table name on INSERT with no values + - Work around possible Storage destruction warnings * Misc - Switch all serialization to use Storable::nfreeze for portable diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 4d18d8d..e14f234 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -206,6 +206,12 @@ sub DESTROY { # some databases spew warnings on implicit disconnect local $SIG{__WARN__} = sub {}; $self->_dbh(undef); + + # this op is necessary, since the very last perl runtime statement + # triggers a global destruction shootout, and the $SIG localization + # may very well be destroyed before perl actually gets to do the + # $dbh undef + 1; } # handle pid changes correctly - do not destroy parent's connection