realbasic-nug
[Top] [All Lists]

Re: Dangerous deallocation/circular reference...

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Dangerous deallocation/circular reference...
From: Kevin Ballard <kevin at sb dot org>
Date: Thu, 11 Jul 2002 17:35:06 -0400
On 7/11/02 5:25 PM, "Joseph J. Strout" <joe at realsoftware dot com> wrote:

> At 2:18 PM -0700 7/11/02, Brady Duga wrote:
> 
>> Specifically, the Tickled object has an array of objects that it
>> treats as a stack - every second it tells the object at the end of
>> the array to do something
> 
> HOW?  How does it do something every second, if the timer does not
> have a reference to it?  Are you running it in a thread that sits in
> a loop and watches the Ticks value, or what?

The Tickler is instantiated. The Tickled is instantiated. Both are linked
together. Then the variables go out of scope. Now there are no external
references. The Tickler is kept alive by the Tickled, and the Tickled is
kept alive by the Tickler. That's now it works. And since the Tickler is a
timer, it continues to call the Tickled periodically.

-- 
Kevin Ballard
kevin at sb dot org
Email from Korea or China must go to <kevin dot nb at sb dot org>
http://kevin.sb.org/



<Prev in Thread] Current Thread [Next in Thread>