[wp-trac] [WordPress Trac] #11780: Memory Leak in plugins_api

WordPress Trac wp-trac at lists.automattic.com
Mon Feb 15 14:52:29 UTC 2010


#11780: Memory Leak in plugins_api
--------------------------+-------------------------------------------------
 Reporter:  hakre         |        Owner:         
     Type:  defect (bug)  |       Status:  closed 
 Priority:  normal        |    Milestone:         
Component:  General       |      Version:  3.0    
 Severity:  normal        |   Resolution:  invalid
 Keywords:  needs-patch   |  
--------------------------+-------------------------------------------------
Changes (by miqrogroove):

  * status:  new => closed
  * resolution:  => invalid
  * milestone:  3.0 =>


Comment:

 In PHP there is no such thing as "return by reference" by the normal
 definition.  PHP always uses references for return variables.  The only
 exception is when there's a scope conflict, as in, {{{return
 $GLOBALS['abc'];}}} or {{{return $this->var;}}} when PHP implicitly
 returns by value.

 Most of the examples cited above are probably returning cached objects,
 which would be maintained as separate copies unless explicitly referenced
 when returned.

 plugins_api() returns a local variable and needs no special treatment.

 Enjoy!

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11780#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list