On Dec 31, 2007 4:22 PM, James Sentman <james at sentman dot com> wrote:
> That being said there is nothing wrong
> with circular references! I use them all the time for similar things,
> a timer that stores a reference to it's socket for example so that it
> can signal a timeout and the socket maintains a reference to the timer
> so that it can cancel or reset it. This is a circular reference and if
> you just kill the socket and set it's reference in whatever list you
> hold them in to nil that socket and it's timer will hang around lost
> in memory forever because they still reference each other.
Not so. The reason they hang around in memory is because sockets are a
special case and are not destroyed even when their reference is lost. See
Aaron's Socket Readme: "One of the new features of sockets in
REALbasic 5.0is the ability to orphan a socket... The socket will
continue to live and
stay connected, even though there is nothing owning a reference to it." This
has been a feature of sockets for a few years now.
--
-Adam
dingostick.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|