Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Releasing a timer from within itself
Message
 
 
To
10/09/2007 14:51:10
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
01253513
Message ID:
01253528
Views:
22
This message has been marked as the solution to the initial question of the thread.
Frank,

Any VFP object can be released only when its 'use counter" is 0. When you're in the object, it's "use counter" is at least one and, as result, it cannot be released. In your code property will be removed but object will still exists w/o any way to access it anymore.

>I am getting a error while using the Beautify utility. So I started to review HOME() + "\tools\xsource\vfpsource\beautify\beautify.prg" when I came upon this gem on Line 337:
>
>* We embed the timer in a form because we can release the form within
>* itself but we can't release a timer within itself (prevents timer
>* reference from hanging around after we're done with it)
>
>My question is, if I attach a timer (or indeed other objects, like a custom perhaps) to the _SCREEN and then subsequently issue a
_SCREEN.RemoveObject("ObjectName")
Would that not release the object?
>
>Furthermore, could I not subclass the timer, adding a Release method:
>
>IF TYPE("This.Parent") = [O] AND PEMSTATUS(THIS.PARENT,"RemoveObject",5)
>     This.Parent.RemoveObject(This.name)
>ENDIF
>RELEASE This
>
>Wouldn't that release basically any object regardless of class?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform