Minor cleanups after rebase
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Cursor.pm
index bf17e90..bfc31af 100644 (file)
@@ -177,10 +177,14 @@ sub _check_dbh_gen {
 }
 
 sub DESTROY {
-  # None of the reasons this would die matter if we're in DESTROY anyways
   if (my $sth = $_[0]->sth) {
-    local $SIG{__WARN__} = sub {};
-    try { $sth->finish } if $sth->FETCH('Active');
+    # cleanup only core DBI handles, for anything more esoteric we
+    # assume they know how to clean up ater themselves
+    if ($sth->isa('DBI::st')) {
+      local $SIG{__WARN__} = sub {};
+      # None of the reasons this would die matter if we're in DESTROY anyways
+      try { $sth->finish } if $sth->FETCH('Active');
+    }
   }
 }