Reference counting (devel. question) (fwd)
Erik Alapää
alapaa at operax.com
Sat May 28 13:11:10 UTC 2005
On Fri, 27 May 2005, David W. Hankins wrote:
>
> When an object is created, it starts with a reference count of 1.
> When you attach an object to another, you want to blah_reference()
> it, to increment that counter...when you're done with it,
> blah_dereference() will both decrement the counter and null out your
> pointer...if the reference count reaches zero, it is freed.
>
>
> Does that help?
>
Yes. I already guessed that was the way to do it and added reference
and dereference calls. Thanks for the info!
Regards,
--
Erik Alapää
Software Engineer M. Sc., Lic. Ind. Math.
Aurorum Science Park 8
SE 997 75 Luleå
Sweden
+46 70 535 17 14 (mobile)
+46 920 75510 (fax)
http://www.operax.com
More information about the dhcp-hackers
mailing list