Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difference and When to use NEW/ADD/CREATEOBJECT()
Message
De
15/04/2004 12:00:14
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
15/04/2004 10:30:07
John Deupree
Long Term Care Authority
Tulsa, Oklahoma, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00894349
Message ID:
00895179
Vues:
24
John-

PMFJI...

>Great information! I thought I knew how these worked, but now realize I didn't quite have it right. Re: object clean up - I use CREATEOBJECT to instantiate a business object based on the DE class on a form.
>
THISFORM.oSrvPlan = CREATEOBJECT('boSrvPlan',1)
>Are you saying that the object is not released when the form is released, even though the BO is 'tied' to a form property?

You're not seeing a problem with your form's releasing? Generally this technique has been a cause of dangling object references in my experience. My habit now is to include clean up code in the destroy(). For example,
*thisform.destroy()
WITH THIS
  STORE .NULL. TO .oSrvPlan
ENDWITH
The construction is just my habit since I may have more than one member I need to .NULL. in the cleanup code.

In the case of member arrays whose elements contain objects, I'm in the habit--based on past experience-- of setting each element to .NULL. before setting the member to .NULL.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform