Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Won't release the form
Message
From
10/08/2001 06:21:28
 
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00542159
Message ID:
00542188
Views:
28
>Hi!
>
>Let say, goRefMgr is a public variable holding the object responsible for managing cross-references in your applicatiosn. When you release certain object that you know could be referenced elsewhere in your application, in the Destroy event of that object call goRefMgr.GoingToDestroy(this), for example. As you see, you pass a reference to method. In the method:
>
>
>lparameters poObject
>...
>for i=1 to alen(this.aReferences,1) &&  aReferences hold all references to objects
>  if poObject = this.aReferences[i] && compare 2 object references...
>    this.aReferences[i] = ''
>    adel(...)
>  endif
>endfor
>
>
>I also do not know if ASCAN will work for object references, but you can try.
>
>Without generic approach and some kind of concept related to objects referencing you will get a lot of situations when form or certain object do not release from memory, and it will be hard to figure out all places with such references. Doing referencing through some kind of centralized tool (references manager) will h elp you to track all of them.
>
>HTH.
>
>>>Hi!
>>>
>>>No. Just before releasing object you have to clear these references. So you require to establish both way referencing - when you hold object reference, that object should know about that for case it is gonna to destroy self and know what to clear. Well, you can use public variables for that, but this is not a good thing. Better use some sort of manager object that will hold a collection of object references. You can than find your object in that collection by simple compare of references - object references are correctly comparable in VFP.
>>
>>Vlad
>>
>>Sorry for sounding a bit thick here, but how can I compare the object references in the manager?
>>
>>Kev

Vlad

Thanks for that, I know what you're saying now, I have actually been having a problem where forms are not releasing properly, so I will use this method.

Thanks
Kev
Previous
Reply
Map
View

Click here to load this message in the networking platform