[Solar-talk] Memory problems

Paul M Jones pmjones at ciaweb.net
Tue Nov 13 18:12:59 CST 2007


Hi Jeff,  good to see you here.  :-)


On Nov 13, 2007, at 5:31 PM, Jeff Moore wrote:

> On Nov 13, 2007, at 8:56 AM, Paul M Jones wrote:
>
>> * Sounds like we need a __destruct() method for the record class  
>> that kills off child objects (like relateds, other models, etc).   
>> Perhaps we need to go back through *all* the model classes and  
>> check for parent/child circular relationships.
>
> Hello,
>
> I think its a bit misleading to use the __destruct() method for  
> this purpose and call it manually.  May I suggest an alternative  
> name, such as free() that doesn't imply that it will be called  
> automatically and that won't be performing a redundant operation,  
> as unset is in __destruct when that method is called automatically?

Oooh ... that's a really good point.  I was keying off of the  
solution presented in the bug report on that issue, but you might be  
on to something there.

Do you think it would sufficient and wise for the free() method to  
call __destruct() internally, or for __destruct() to call the free()  
method internally?



--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.  <http://solarphp.com>

Join the Solar community wiki!  <http://solarphp.org>

Savant: The simple, elegant, and powerful solution for
templates in PHP.  <http://phpsavant.com>




More information about the Solar-talk mailing list