better DESTROY handling
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI.pm
index 0ded000..a26f157 100644 (file)
@@ -1157,7 +1157,13 @@ sub build_datetime_parser {
   return $type;
 }
 
-sub DESTROY { shift->_dbh(undef) }
+sub DESTROY {
+  my $self = shift;
+  return if $self->_dbh;
+
+  $self->_verify_pid;
+  $self->_dbh(undef);
+}
 
 1;