Memory leaks have gone, oh happy days are here again..
[catagits/Catalyst-Runtime.git] / lib / Catalyst / ClassData.pm
index 3882ccd..6174ffd 100644 (file)
@@ -14,7 +14,7 @@ sub mk_classdata {
   my $accessor =  sub {
     my $pkg = ref $_[0] || $_[0];
     my $meta = $pkg->Class::MOP::Object::meta();
-    if (@_ > 1){
+    if (@_ > 1) {
       $meta->namespace->{$attribute} = \$_[1];
       return $_[1];
     }
@@ -53,7 +53,7 @@ sub mk_classdata {
   $meta->add_method($alias, $accessor);
   $meta->add_method($attribute, $accessor);
   if(defined $immutable_options){
-    $meta->make_immutable($immutable_options);
+    $meta->make_immutable(%{ $immutable_options });
   }
   $class->$attribute($_[2]) if(@_ > 2);
   return $accessor;