Re: Custom object creation and reference counts
| From: | Andrei Zmievski | Date: | Sat, 03 Jan 2004 01:00:33 +0000 |
| Subject: | Re: Custom object creation and reference counts | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-6754@lists.php.net to get a copy of this message | ||
On Fri, 02 Jan 2004, Jon Parise wrote:
> It appears to be a side-effect of not defining the 'scope' field in
> the zend_internal_function call that is invokved from my custom
> 'constructor_get' handler. If the 'scope' field is NULL, my object
> is treated as a reference. If I assign my class entry to the 'scope'
> field, the object is "normal" (i.e. not a reference).
Hmm, can I see the code?
> > zval_dtor() will. It calls del_ref on the underlying object.
>
> I see. I would have to call zval_dtor() myself in any of the cases
> where I knowingly created an additional reference. That makes sense.
Ditto. :)
- Andrei