Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Trigger Destroy() Event-- Foxpro DLL memory prob
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00532817
Message ID:
00533254
Vues:
13
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform