On Tue, Sep 8, 2009 at 4:42 PM, Rick McGuire <object.r...@gmail.com> wrote:

> Yes, this is safe....currently.  However, the success of this depends
> entirely on the characteristics of the garbage collector.  You
> shouldn't assume that the reference passed directly to your method is
> necessarily a direct reference to the object, so good practice
> dictates you should request a global reference for that object.

Okay, so that does seem like good practice.  I was worried about
releasing the global reference, worried that if it wasn't released,
the interpreter would not terminate.

But simple experimentation shows that the interpreter doesn't hang
when the ooDialog program ends, if I don't release the reference.

Even so, I'm wondering if I'm over-looking something.  The class
object I am stashing is the PlainBaseDialog class object, which I use
a reference to right off the bat.  So, I'm saving the reference (and
doing the global request) in the PlainBaseDialog class init() method.

The class should be / needs to be valid as long as the ooDialog
package is loaded.  Should I add a class uninit method and release the
reference there?

Which seems like it might not work anyway.  If the uninit is not run
until the object is garbage collected and the object is not garbage
collected until the global reference is released, it seems a little
circular.  ?

Should I not worry about releasing the reference, or is there a better
place / way to release it?

--
Mark Miesfeld

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to