Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
'N-Tier' Data Entry Form does not 'release' completely
Message
De
21/02/2008 10:06:50
 
 
À
21/02/2008 09:58:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
01294612
Message ID:
01294748
Vues:
15
>Fred,
>
>I have already put this code in the BO's Destroy Event:
>
>
>This.oDataLayer = NULL
>
>
>Still, it doesn't work. Is that 'enough'?
>
>I tried to do the following: I intentionally did not put any object reference on the BO.oDataLayer, which obviously resulted in an error. Upon closing the form, and checking on DataSession window, it released properly! So this means that it is the aberration is due to the oDataLayer object reference?
>
>Thanks! And more help please!
>
>Dennis


No, you can't do it in the BO.Destroy because that happens too late. The form already tried to Destroy and couldn't because of the outstanding reference. The order for .Destroy method firing is outer to inner, IE, the Form.Destroy executes first.

You either have to do in the Form.Destroy:
thisform.BO.oDataLayer = .NULL.

Or you can use BINDEVENT in the BO.Init to call some cleanup code in your BO:
*BO.Init:
BINDEVENT(thisform,"Destroy",this,"CleanUp",1)
*BO.CleanUp:
this.oDataLayer = .NULL.

At least that way the form doesn't have to know how to cleanup after other objects.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform