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