comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: object reference destroy
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: object reference destroy [message #67051 is a reply to message #67049] Wed, 24 June 2009 11:33 Go to previous messageGo to previous message
BlackMage is currently offline  BlackMage
Messages: 2
Registered: August 2008
Junior Member
An alternative is to implement reference counting. I have implemented
this for my own code and found it very effective, all my classes have
the reference counting class as the root of their inheritance. When
the reference-counting object is created or another object tells it
that it 'owns' a reference to it, the count increases. Once other
objects no longer need the owning reference, they tell the reference-
counting object and the count decreases. Once the count hits zero, the
reference-counting object destroys itself. If the reference-counting
object is destroyed with a non-zero count, it complains and this
assists debugging.

This approach has been very effective for me in object management as I
am no longer trying to work out exactly what part of my code holds the
final reference to any given object so I can destroy it when, and only
when, it is no longer needed. It's especially useful if you have
multiple collections of the same object references e.g. search trees
or linked lists.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 7.1.1 Workbench update for Macintosh OS X
Next Topic: Re: AT&T Usenet Netnews Service Shutting Down

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 23:05:22 PDT 2025

Total time taken to generate the page: 0.80135 seconds