At 3:35 PM +0100 3/6/06, Marco Bambini wrote:

        Dim myOBJ As myClass = New myClass
        myArray.Append myOBJ
loop ...

myArray is an array of myClass.

The problem is that when I need to dispose the array I have tried both:
redim myArray(-1)

This is correct.

and

for i=0 to UBound(myArray)
        myArray.(i) = nil
next
redim myArray(-1)

This is doing unnecessary work.

but memory is never freed (i can see this in the Activity Monitor).

What I am doing wrong?

Trusting the Activity Monitor, perhaps? Remember, REALbasic does its own memory management, and maintains a "recycle pool" of allocated blocks; the Activity Monitor is not privvy to this. So it could be that your objects have been released just fine, even if AM doesn't show it. Use the Runtime module to find out whether those objects are still hanging around.

If they are, then it would be because something else still has references to these objects (or they have references to each other).

Best,
- Joe

--

Joseph J. Strout
[EMAIL PROTECTED]
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to