Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems releasing a class
Message
From
11/07/2000 14:35:46
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00390393
Message ID:
00390872
Views:
9
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.
Charlie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform