my $storage = $weak->{storage} = $s->storage;
memory_cycle_ok($storage, 'No cycles in storage');
- my $dbh = $weak->{dbh} = $s->storage->_get_dbh;
- memory_cycle_ok($dbh, 'No cycles in DBI handle');
-
- my $sqla = $weak->{sqla} = $s->storage->sql_maker;
- memory_cycle_ok($sqla, 'No cycles in SQL maker');
-
my $rs = $weak->{resultset} = $s->resultset ('Artist');
memory_cycle_ok($rs, 'No cycles in resultset');
my $row = $weak->{row} = $rs->first;
memory_cycle_ok($row, 'No cycles in row');
+ my $sqla = $weak->{sqla} = $s->storage->sql_maker;
+ memory_cycle_ok($sqla, 'No cycles in SQL maker');
+
+ my $dbh = $weak->{dbh} = $s->storage->_get_dbh;
+ memory_cycle_ok($dbh, 'No cycles in DBI handle');
+
+ for (@{$dbh->{ChildHandles}}) {
+ $weak->{"$_"} = $_ if $_;
+ }
+
weaken $_ for values %$weak;
memory_cycle_ok($weak, 'No cycles in weak object collection');
}