diff Lib/IMPL/Web/View/TTRegistry.pm @ 305:b5d5793f348e

TTView refactoring, still experiencing memory leaks
author sergey
date Wed, 17 Apr 2013 18:00:19 +0400
parents 2ff513227cb4
children 5e4e7c8fbca1
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTRegistry.pm	Mon Apr 15 07:44:50 2013 +0400
+++ b/Lib/IMPL/Web/View/TTRegistry.pm	Wed Apr 17 18:00:19 2013 +0400
@@ -1,5 +1,6 @@
 package IMPL::Web::View::TTRegistry;
 use strict;
+use mro;
 
 use IMPL::Const qw(:prop);
 use IMPL::declare {
@@ -7,7 +8,8 @@
         TTFactory => 'IMPL::Web::View::TTFactory'        
     },
     base => [
-        'IMPL::Object' => undef
+        'IMPL::Object' => undef,
+        'IMPL::Object::Disposable' => undef
     ],
     props => [
         loader => PROP_RW,
@@ -16,6 +18,14 @@
     ]
 };
 
+sub CTOR {
+	my ($this,$loader,$context) = @_;
+	
+	$this->loader($loader);
+	$this->context($context);
+	$this->_cache({});
+}
+
 sub Require {
     my ($this,$name) = @_;
     
@@ -37,6 +47,30 @@
     }
 }
 
+sub Dispose {
+	my ($this) = @_;
+	
+	$this->_cache(undef);
+	$this->context(undef);
+	$this->loader(undef);
+	
+	$this->next::method();
+}
+
 1;
 
 __END__
+
+=pod
+
+=head1 NAME
+
+C<IMPL::Web::View::Registry> - реестр шаблонов документа.
+
+=head1 DESCRIPTION
+
+Используется для реализации функции C<require> внутри шаблонов.
+
+
+
+=cut