Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dangling reference
Message
De
30/05/2002 13:42:42
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00663016
Message ID:
00663118
Vues:
24
>>Hi Nadya,
>>
>>do you mean, you're adding an object to _SCREEN or to the form?
>>
>>Armin
>>
>>>I found, that if form has a private DS and in the life of the form we add some object to the screen, the Form's datasession remains open after form is closed...

I've noticed the things happening the other way around: any object's method will run in the datasession in which the object was created. It seems you've found the connection from the other end: any datasession will stay alive as long as there's any object which would want to run in it. There seems to be an implicit reference here.

>It's a program by Rick Bean, which simulates timeout messagebox in VFP6. In the program code the timer object is added to the screen. This somehow caused form's DS to remain open. Yesterday in the everning I logged through PCAnywhere and tried few approaches to remove reference, but got errors. So finally I got rid of _screen at all and release the variable, which holds the object reference at the end of the program. This fixed the problem.

>However, the point of adding this object to the screen, as I understand it, was to not instantiate the object again, if it was already added. Anyway, Init doesn't take much time, so I guess, it was the best approach to take.

I think you could still addobject() it to _screen, as long as you Set DataSession to 1 just before that, or you could add it sometime early in the application before you show any form (and thus all the code still lives in DataSession 1).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform