Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Release An Object
Message
From
08/10/1998 20:22:46
 
 
To
08/10/1998 19:53:07
Dave Nantais
Light speed database solutions
Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00145291
Message ID:
00145302
Views:
26
>I created an object using CREATEOBJECT and placed a method in
>the object called "RELEASE".
>
>The method had only one statement ...
>
>"RELASE THIS"
>
>Later on in the procedure i attempt
>
>OBJECTNAME.RELEASE
>
>but the variable still exists in memory.
>
>As a work around i simply do a RELEASE OBJECTNAME
>and this works fine.
>
>However isnt the RELEASE method supposed to work as well?
>
>TIA,
>Dave.

To truly release an object, you need to release all references to it. An object holds an internal reference counter and will not go away until it reaches 0. The right way to do this is by assigning the object to a variable when it is created, and then releasing the variable when you want it to go away.

PRIVATE oObj
oObj = CREATEOBJ('myclass')

RELEASE oObj
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform