Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to free object instances?
Message
From
12/12/1997 22:55:03
 
 
To
12/12/1997 22:42:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00065705
Message ID:
00065709
Views:
39
>>>Can anyone tell me how i can release a single object instance of a user-defined class from memory?
>>>
>>>i do not want to wait for the object instance to go out of scope or wait for the program to end or to do a CLEAR ALL to achieve this.
>>>
>>>Example: i have an object-reference 'oTest'
>>>oTest = CREATEOBJECT('clsTest')
>>>
>>>Any help will be appreciated!
>>>Many thanks :)
>>>
>>>Mazlan Bin Mohammad
>>
>>oTest=.NULL.
>>
>>:0)
>
>(Beggin everyone's pardon...i know that sleepiness is not an excuse to have asked the question i initially asked)

Don't excuse yourself. This is why UT exists! :)

>i think oTest.Destroy does the job too. Am i rite?

No. Destroy is an event. The right way is the one Gérald gave. Another way to skin the same cat is:

RELEASE oTest

There's a little difference between these 2 methods:
oTest = .NULL. will detroy the object, but the oTest variable still exists and TYPE("oTest") still returns "O". RELEASE oTest destroys the object and the oTest variable. You can use one or the other, depending on your needs.

Vlad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform