better DESTROY handling
Brandon L. Black [Sun, 23 Jul 2006 19:07:58 +0000 (19:07 +0000)]
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;