From: Peter Rabbitson Date: Sat, 9 Jan 2010 01:10:13 +0000 (+0000) Subject: A "fix" for sqlt-related schema leaks X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3bf702eba822562d276794d6f6d9d5fc34540d9b;p=dbsrgits%2FDBIx-Class-Historic.git A "fix" for sqlt-related schema leaks --- diff --git a/lib/SQL/Translator/Parser/DBIx/Class.pm b/lib/SQL/Translator/Parser/DBIx/Class.pm index 705d380..a94915a 100644 --- a/lib/SQL/Translator/Parser/DBIx/Class.pm +++ b/lib/SQL/Translator/Parser/DBIx/Class.pm @@ -15,6 +15,7 @@ $DEBUG = 0 unless defined $DEBUG; use Exporter; use SQL::Translator::Utils qw(debug normalize_name); use Carp::Clan qw/^SQL::Translator|^DBIx::Class/; +use Scalar::Util (); use base qw(Exporter); @@ -30,6 +31,10 @@ use base qw(Exporter); # We're working with DBIx::Class Schemas, not data streams. # ------------------------------------------------------------------- sub parse { + # this is a hack to prevent schema leaks due to a retarded SQLT implementation + # DO NOT REMOVE + Scalar::Util::weaken ($_[1]); + my ($tr, $data) = @_; my $args = $tr->parser_args; my $dbicschema = $args->{'DBIx::Class::Schema'} || $args->{"DBIx::Schema"} ||$data;