Yep. This helps a lot.
Thanks, Doug.
>Hi Matt.
>
>>In the code I declare a public loBo variable to hold the object so I can make further use of it from the command window if I wanted to. After further testing, I RELEASE loBo, then I try to open the parent class of the class I tested so I can edit it, but it says: "Remove classes from memory?" and I click "Remove", then it says "Cannot modify a class that is in use".
>
>Instead of RELEASE loBo, use loBo.Release (you may have to add a Release method to the object). The difference is that RELEASE loBo releases the memory variable holding a reference to the object, but not necessarily the object itself if a reference to it is also stored somewhere else. For example, suppose loBo contains a reference to ObjectA, ObjectA contains (in a property) a reference to ObjectB, and ObjectB contains (in a property) a reference to ObjectA. RELEASE loBo releases the memory variable, but because ObjectB also contains a reference to ObjectA, ObjectA (and therefore ObjectB) can't be destroyed. However, since the memory variable is now gone, you have no way to reference either ObjectA or B.
>
>Instead, in the Release method of your objects, make sure you clean up any references that may be outstanding. For example, in ObjectA.Release:
>
>
This.oObjectB.Release()
>release This
>
>In ObjectB.Release:
>
>
This.oObjectA = .NULL.
>release This
>
>Now, loBo.Release() will release all references to both ObjectA and B.
>
>Doug