>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.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement