Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Trigger Destroy() Event-- Foxpro DLL memory prob
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00532817
Message ID:
00533254
Views:
12
Robert,

Destroy() is an event, it is a notification that an object is being removed from memory because there are no more object references to it. This gives you a chance to do any final clean up before it's gone.

You can not call the Destroy() with the intent of causing the object to destruct it simply won't happen. Do this code in the command window one line at a time:
ox = createobject( "form" )
ox.Visible = .t.

? ox.Destroy() && form is still there

ox = .null. && form now goes away
If you turn on event tracking in the debugger you can see that Destroy is triggered only once the ox = .null. executes. It does not happen when the ? ox.Destroy() is called.

>Well, add a call to destroy the lower-level class in the destroy() function of the upper-level class.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform