Revision history for DBIx::Class
+0.06003
+ - added memory cycle tests and a long-needed weaken call
+
0.06002 2006-04-20 00:42:41
- fix set_from_related to accept undef
- fix to Dumper-induced hash iteration bug
use warnings;
use Carp::Clan qw/^DBIx::Class/;
+use Scalar::Util qw/weaken/;
use base qw/DBIx::Class/;
$reg{$moniker} = $source;
$self->source_registrations(\%reg);
$source->schema($self);
+ weaken($source->{schema}) if ref($self);
if ($source->result_class) {
my %map = %{$self->class_mappings};
$map{$source->result_class} = $moniker;
--- /dev/null
+use strict;
+use warnings;
+use Test::More;
+
+use lib qw(t/lib);
+
+BEGIN {
+ eval { require Test::Memory::Cycle };
+ if ($@) {
+ plan skip_all => "leak test needs Test::Memory::Cycle";
+ } else {
+ plan tests => 1;
+ }
+}
+
+use DBICTest;
+use DBICTest::Schema;
+
+import Test::Memory::Cycle;
+
+my $s = DBICTest::Schema->clone;
+
+memory_cycle_ok($s, 'No cycles in schema');