perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-docs/src/docs/2.0/api/Apache SubRequest.pod
Date Mon, 27 Sep 2004 21:46:48 GMT
stas        2004/09/27 14:46:48

  Modified:    src/docs/2.0/api/Apache SubRequest.pod
  Log:
  never call $subr->DESTROY explicitly or you will be sorry
  
  Revision  Changes    Path
  1.7       +12 -8     modperl-docs/src/docs/2.0/api/Apache/SubRequest.pod
  
  Index: SubRequest.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/SubRequest.pod,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -u -r1.6 -r1.7
  --- SubRequest.pod	27 Aug 2004 01:09:45 -0000	1.6
  +++ SubRequest.pod	27 Sep 2004 21:46:48 -0000	1.7
  @@ -21,8 +21,6 @@
     $subr = $r->lookup_uri("/foo", $r->output_filters);
     # now run them
     my $rc = $subr->run;
  -  # optional
  -  $subr->DESTROY;
   
   
   
  @@ -51,9 +49,9 @@
   
   =head2 C<DESTROY>
   
  -Free the memory associated with a sub request
  +Free the memory associated with a sub request:
   
  -  $subr->DESTROY();
  +  undef $subr; # but normally don't do that
   
   =over 4
   
  @@ -68,10 +66,16 @@
   
   =back
   
  -This method will be called automatically when C<$subr> goes out of
  -scope, so there is no need to call it explicitly, unless you want to
  -free the memory earlier than that (for example if you run several
  -subrequests).
  +C<DESTROY> is called automatically when C<$subr> goes out of scope.
  +
  +If you want to free the memory earlier than that (for example if you
  +run several subrequests), you can C<undef> the object as:
  +
  +  undef $subr;
  +
  +but never call C<DESTROY> explicitly, since it'll result in
  +C<ap_destroy_sub_req> being called more than once, resulting in
  +multiple brain injuries and certain hair loss.
   
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org


Mime
View raw message