Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing a timer from within itself
Message
 
 
À
10/09/2007 14:51:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
01253513
Message ID:
01253528
Vues:
23
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform