Audit all local() calls within lib/ and t/lib
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Schema.pm
index c0cba10..3bcc37f 100644 (file)
@@ -908,6 +908,7 @@ sub compose_namespace {
       }
     }
 
+    # Legacy stuff, not inserting INDIRECT assertions
     quote_sub "${target}::${_}" => "shift->schema->$_(\@_)"
       for qw(class source resultset);
   }
@@ -1057,7 +1058,7 @@ sub throw_exception {
 
     my $guard = scope_guard {
       return if $guard_disarmed;
-      local $SIG{__WARN__};
+      local $SIG{__WARN__} if $SIG{__WARN__};
       Carp::cluck("
                     !!! DBIx::Class INTERNAL PANIC !!!
 
@@ -1435,7 +1436,7 @@ sub DESTROY {
     # due to some weird race condition during thread joining :(((
     if (length ref $srcs->{$source_name} and refcount($srcs->{$source_name}) > 1) {
       local $SIG{__DIE__} if $SIG{__DIE__};
-      local $@;
+      local $@ if DBIx::Class::_ENV_::UNSTABLE_DOLLARAT;
       eval {
         $srcs->{$source_name}->schema($self);
         weaken $srcs->{$source_name};