Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to nuke objects in Destroy?
Message
 
To
26/08/2009 11:59:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01405727
Message ID:
01420863
Views:
65
Hi Matt,

>So, how can you scan the over the properties like above, without having to know the property names?

Three problems. I'm German, we always talk about the problems first ;-)

1. Destroy is too late. If you have a dangling reference, Destroy doesn't fire.

2. Just setting these properties to NULL works, if they object only holds a reference in case it needs to access those. However, in many cases there's some of protocol established: Objects register with a mediator, some objects subscribe to events, etc. Whenever one object established a mutual relationship with another object you need to break this relationship before clearing the property.

3. To avoid dangling references, it's not enough to clear reference in your object. You also have to clear all references that point _TO_ your object. As object references are one ways, there's no really easy and generic way to find all these references automatically.
--
Christof
Previous
Reply
Map
View

Click here to load this message in the networking platform