Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Proper Object Cleanup after Instantiation
Message
De
24/05/2002 09:54:22
 
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00660655
Message ID:
00661020
Vues:
33
Kevin,

I was not releasing objects I had instantiated (which (I will correct),but have other examples of behavior I don't understand:
(1) I have a cbizobjModal Form set to private data session, that I've dropped several control classes I've created that have bizobjs on them to drive the controls. They were created on a form and then just the controls were "saved as class" to create them. When I run the form and close it multiple times, I have all the tables still open in datasessions called unknown(1), unknown(2) etc.
(2) I have a cbizobform, set to private datasession, (List of Journals) that I added a clistobjedit class that I have calling a cbizobjMaintenace form set to default datasession (individual records making up journal). When I run the cbizobform and exit without calling the cbizobjMaintenace form everything cleans up. If do call the cbizobjMaintenace form, however many times, then I get the datasessions called unknown(1), unknown(2) etc. I thought the dataenvironment would close all open tables in a private data session when the dataenvironment was released.

What causes unknown(1), unknown(2) etc.
What can you suggest?

Gary.

>Gary
>>What I should be doing to not have datasession leftovers properly clean up my instantiated bizobj classes?
>
>>Also, does using this.addobject() add any automatic house keeping of benefit or is direct instantiation in code just as good?
>
>If you're dropping business objects on the form at design time and not cross-registering any objects with each other, then the Framework can handle the cleanup for you. If you've dynamically added a business object to the form, and are holding references to it in one or more additional places, you'll want to make sure you clear those references and manually release the business object by calling its Release() method. You might want to look closer at the forms in which this is occurring and see if you're doing any of these things.
>
>Regards,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform