Fix segfault in t/storage/quote_names.t
[dbsrgits/DBIx-Class.git] / t / 52leaks.t
index ce6d14c..1a052ef 100644 (file)
@@ -188,8 +188,6 @@ unless (DBICTest::RunMode->is_plain) {
 
     result_source_handle => $rs->result_source->handle,
 
-    fresh_pager => $rs->page(5)->pager,
-    pager => $pager,
     pager_explicit_count => $pager_explicit_count,
 
   };
@@ -203,6 +201,8 @@ unless (DBICTest::RunMode->is_plain) {
     storage => $storage,
     sql_maker => $storage->sql_maker,
     dbh => $storage->_dbh,
+    fresh_pager => $rs->page(5)->pager,
+    pager => $pager,
   );
 
   if ($has_dt) {
@@ -291,9 +291,8 @@ for my $slot (keys %$weak_registry) {
     delete $weak_registry->{$slot}
       unless $cleared->{hash_merge_singleton}{$weak_registry->{$slot}{weakref}{behavior}}++;
   }
-  elsif ($slot =~ /^__TxnScopeGuard__FIXUP__/) {
+  elsif (DBIx::Class::_ENV_::INVISIBLE_DOLLAR_AT and $slot =~ /^__TxnScopeGuard__FIXUP__/) {
     delete $weak_registry->{$slot}
-      if $] > 5.013001 and $] < 5.013008;
   }
   elsif ($slot =~ /^DateTime::TimeZone/) {
     # DT is going through a refactor it seems - let it leak zones for now