Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Undestroyed objects in forms
Message
 
À
23/03/1998 13:06:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00086484
Message ID:
00086502
Vues:
29
>>I would be interested in knowing the answer to this question: Which objects in the base class library do not get destroyed properly when you close a form? I spent this weekend looking at a problem on a form which wasn't running its Unload() method when you closed the form from the Close Box. It turned out that two label objects and two other objects on a page frame were not being destroyed when the form closed, thus preventing Unload() from firing. When I forced the destroy within the destroy method of the page, it worked fine. (The two other objects were child classes of the base class TextBox.)
>>
>>Ed
>
>If those are label 'objects' and other objects on a pageframe, are you sure they are not involved in running some method which is either being called recursively or in a cyclic relation? If not, force a NULL to all of them in the Destroy event of the form (if they are objects)

Sanjay,

I've encountered this suggestion before, assigning NULL to an object pointer, but I've never really understood why. If the object is already gone, isn't the pointer already NULL? If it didn't destroy like it should, then am I not orphaning a piece of memory that will eventually make its way to the global OS heap and float around there until the machine is turned off?

Regarding the objects themselves, I don't believe they are involved in a recursive call or cyclic relationship? In fact, the label object just 'is'...there is no code attached to it at all.

Ed
Edward Johnson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform