Audit all local() calls within lib/ and t/lib
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSource.pm
index c51c45d..725f30d 100644 (file)
@@ -2371,7 +2371,7 @@ sub DESTROY {
   # however beware - on older perls the exception seems randomly untrappable
   # due to some weird race condition during thread joining :(((
   local $SIG{__DIE__} if $SIG{__DIE__};
-  local $@;
+  local $@ if DBIx::Class::_ENV_::UNSTABLE_DOLLARAT;
   eval {
     weaken $_[0]->{schema};