Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems releasing a class
Message
 
 
À
11/07/2000 14:35:46
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00390393
Message ID:
00390894
Vues:
9
The problem occurs when releasing the App object. The Destroy is what is hanging. If the Destroy method clears the object reference, it should proceed without incident.

Release is actually a specific term used only by Forms and Formsets. A lot of developers add a Release method to their baseclasses with a Release THIS in it. It does make things easier to understand.

FWIW, if a Release method is added to the App object, the CloseApp method could perform its normal cleanup and then make a call to its Release method.

>Hi Larry, Christian,
>I don't think putting [code you need to run to release an object] in the Destroy will help. If it could destroy, it wouldn't hang.
>
>In Debug mode, I would just Cancel, then Object.CloseApp(). If all objects have a Release, it makes it easier to remember the method to envoke. CloseApp is specific, but in an abstract sense, don't you just want the app to go away. What's the generic term for that? Release().
>
>
>>>>I've experienced this problem when I have forgotten to clear object references. If you assign object references to a property of your application object and don't clear it by setting it to .NULL., VFP could hang trying to clear out the memory.
>>>>
>>>>Just a thought.
>>>
>>>This is the case with my registry class, it is assigned to a property of my application object, and now when I set it to NULL in the closeApp method it works fine.
>>>But suppose you have a program error and you want to step out of the program without being able to trigger the CloseApp method where you set object references to Null?
>>
>>Add it to the Destroy event of your application object or call a custom method from the Destroy method. This way, even if you clear all, as soon as the application is released, it will set its property to .NULL. itself.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform