This is a difficult one, unless...

In RBScript having a class say:

class RBScriptObject
        private dim instanceSig As Integer

        sub Constructor(name As String, className As String, address As String) 
        
                numberOfObjects = numberOfObjects + 1
                instanceSig = numberOfObjects
                gObjectArray(instanceSig) = self
        end sub

        sub Destructor()
                numberOfObjects = numberOfObjects - 1
                gObjectArray(instanceSig) = nil
                instanceSig = 0
        end sub
end class

and global variables:

dim gObjectArray(100) as RBScriptObject
dim numberOfObjects As Integer = 0

If the script is generating a number of local instances of the class and a 
bunch of them go out of scope, the destructor of the class gets called, but not 
in this example, because the gObjectArray holds a reference to it. Because it 
is in RBScript, I have no idea how to make the array not to add a ref to it, 
can't use REALUnlockObject, and looking in the language ref about Weakref 
(which is unclear!), and noting that RBScript does not know anything about 
WeakRef, I am at loss how to find a way to let the destructor fire, other than 
not using an array...

Someone out there giving a hint or two?


- Alfred Van Hoek
[email protected]
http://web.mac.com/vanhoek



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to