Proper fix for the lazy workaround in 7e1774f7
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSource.pm
index 03231c7..0940e0d 100644 (file)
@@ -2376,7 +2376,10 @@ sub DESTROY {
     $global_phase_destroy = 1;
   };
 
-  return;
+  # Dummy NEXTSTATE ensuring the all temporaries on the stack are garbage
+  # collected before leaving this scope. Depending on the code above, this
+  # may very well be just a preventive measure guarding future modifications
+  undef;
 }
 
 sub STORABLE_freeze { Storable::nfreeze($_[0]->handle) }