Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automatic Destroy method
Message
 
 
To
08/08/2007 18:30:08
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01246863
Message ID:
01246935
Views:
29
>>Hi everybody,
>>
>>If I'm creating an object as my form's property such as oBill, for example, I always start it with an 'o'. I'm thinking, is it possible to make a generic Destroy method to SET such objects to NULL instead of making changes to each form class where I'm creating such properties.
>>
>>I guess I can loop through aMembers for the form, check the first letter, etc.
>
>You could also check all properties, if they are of type "O".
>
>>Do you think it's worth the trouble to make a generic Destroy method or it's better to continue the current practice of modifying each individual form's Destroy method?
>
>As to this desirability, I am not quite sure. But do consider that anything you do at the root of the hierarchy of form classes, you will have to do only once. And, it might help you have less hard-to-find bugs, in this case, a form not releasing, 'cause you forgot to destroy some individual object.

Thanks, Hilmar. It is not my application and I haven't checked every form if the references are currently cleared. If I'd found they are not, I'll made this method to be generic.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform