Mark Stosberg wrote:
CGI::Application::Plugin::HTDot currently creates a circular reference,
by adding a reference back to the application object from the template
object, which is already referenced by the application object.

Where do you have a reference to the template object? Aren't your template objects local to the run mode?

The line of code is this:

 $t->param( c => $self ) if $var =~ /^c\./;

Is it correct that it should actually be this?

  use Scalar::Util 'weaken';
  $t->param( c => weaken($self) ) if $var =~ /^c\./;

I think it's a good idea in general. I certainly don't see a drawback. The template shouldn't use (or change!) the value of $self anyway, and weakrefs work just as well for objects.

rhesa

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to