Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C5 and the VFP8ERR.LOG
Message
From
19/01/2004 04:51:59
 
 
To
16/01/2004 13:58:41
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00867106
Message ID:
00868037
Views:
31
>Thanks for that explanation. And, if I understand you right, the only way to create a dangling reference, then, is if I explicitly set a memory variable or property to an object that is contained within a parent object/container. And then, I release the container without resetting the memory variable or property to .null. Is this correct?
>
>Also, you mentioned that the Destroy event occurs too late to prevent the dangling references. I have used the Destroy event to set .null. to any properties that evaluate to an object. I can't rely on the Release method being called. Is there an event/method that I can use to clean up any object references that may exist - perhaps bind the Destroy event to a delegate method so that the delegate method cleans up object references before the Destroy event code executes?

Alan

There is no problem with putting your code in the Destroy event, however, if the object doesn't get released there will be no Destroy, and this is why it's a problem in VFP.

The bottom line is that if you have 2 objects referencing each other then neither of their Destroys will fire, it just doesn't work, unless you have a 3rd object involved which acts as the association between 2 objects, but then it can get quite fiddly then, when all is said and done you just have to try and avoid it.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform