comparison Lib/IMPL/Web/View/TTDocument.pm @ 307:2da2564f115d

*TTView: fixed memory leak
author cin
date Thu, 18 Apr 2013 02:21:28 +0400
parents b5d5793f348e
children 47a09a8dc23a
comparison
equal deleted inserted replaced
306:d4caf951260d 307:2da2564f115d
22 } 22 }
23 ], 23 ],
24 props => [ 24 props => [
25 layout => PROP_RW, 25 layout => PROP_RW,
26 loader => PROP_RW, 26 loader => PROP_RW,
27 baseLocation => PROP_RW
27 ] 28 ]
28 }; 29 };
29 30
30 sub CTOR { 31 sub CTOR {
31 my ($this,$template,$ctx,$loader,$vars) = @_; 32 my ($this,$template,$ctx,$loader,$vars) = @_;
48 49
49 my $registry = TTRegistry->new($this->loader, $documentContext); 50 my $registry = TTRegistry->new($this->loader, $documentContext);
50 51
51 $this->context->stash->update({ 52 $this->context->stash->update({
52 require => sub { $registry->Require(shift) }, 53 require => sub { $registry->Require(shift) },
53 document => $this 54 document => sub { $this }
54 }); 55 });
55 56
56 my $text = eval { 57 my $text = eval {
57 58
58 if ($this->layout) { 59 if ($this->layout) {
86 my $e = $@; 87 my $e = $@;
87 88
88 $registry->Dispose(); 89 $registry->Dispose();
89 undef $registry; 90 undef $registry;
90 $this->context->delocalise(); 91 $this->context->delocalise();
92
93 undef $this;
91 94
92 if ($e) { 95 if ($e) {
93 die $e; 96 die $e;
94 } else { 97 } else {
95 return $text; 98 return $text;