Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bug? Dangling object reference with FOR EACH
Message
De
13/11/2000 18:16:47
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Bug? Dangling object reference with FOR EACH
Divers
Thread ID:
00441354
Message ID:
00441354
Vues:
53
Create a base class form, set it to use a provate datasession, put a command button on it, and put this code in the click event:

lcXML = ""
loXML = CREATEOBJECT("Microsoft.XMLDOM")
loXML.LoadXML(lcXML)
loChildren = loXML.DocumentElement.ChildNodes

FOR EACH loChild IN loChildren
ENDFOR

Run the form, click the button, and close the form. Observe in the Datasession window that you have a new 'unknown' and empty datasession. Getting rid of the FOR EACH loop corrects the problem. Explicitly releasing loChild and /or loChildren, or declaring one or both of them as local variables makes no difference.

I get the same behavior in VFP 6 SP3 and VFP 7 Miami release.
Erik Moore
Clientelligence
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform