Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Destroy object reference
Message
From
08/04/2002 11:17:45
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
08/04/2002 11:06:16
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00642179
Message ID:
00642222
Views:
13
The advise doesn't work for me. I feel more comfortable with thinking about cleaning up in conjunction with destroy.

See http://fox.wikis.com/wc.dll?Wiki~ManualGarbageCollection and you'll notice no calls are made during unload. Although were one to desire to clean up during unload, following Steves advice would be good too.


>>Well, that's why I hedged my bet and left destroy as a second choice. :) Although I can't think of a specific circumstance where waiting until unload() would be a problem.
>>
>>The rule of thumb I follow is this. I try to clean up objects and settings at the same level as I created/changed them. If I create the object at load(), I clean up at unload(). If I do something at init(), I do the cleanup for it at destroy().
>
>That looks like a good rule of thumb. Besides, your answer helped me clarify the relationship between the methods.
>
>In this case, I create a reference to an object on the same screen. At Form.Load(), the objects don't exist yet, so the logical place to create the object reference is Form.Init(). That would leave the destruction to Form.Destroy(), according to your rule-of-thumb.
>
>Hilmar.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform