S
Steven Blair
Hi,
Quick overview of the problem:
public bool Something( out DataSet ds )
{
bool ret=false;
try
{
xmlDocument myXmlDoc = new xmlDocument( myFile.xml );
ds = myXmlDoc.DataSet;
ret=true;
}
catch( Exception e )
{
//Do something
}
return ret;
}
How would the memory for the xmlDocument get released? The object
calling this function would have a reference (correct me if I am wrong)
to the DataSet inside the xmlDocument, so would the c# memory manager
ignore this object?
I thought about replacing:
ds = myXmlDoc.DataSet;
with:
ds = myXmlDoc.DataSet.Copy();
myXmlDoc = null; //Would this allow memory to be released?
Any help on this would be appreciated.
Regards,
Steven
Quick overview of the problem:
public bool Something( out DataSet ds )
{
bool ret=false;
try
{
xmlDocument myXmlDoc = new xmlDocument( myFile.xml );
ds = myXmlDoc.DataSet;
ret=true;
}
catch( Exception e )
{
//Do something
}
return ret;
}
How would the memory for the xmlDocument get released? The object
calling this function would have a reference (correct me if I am wrong)
to the DataSet inside the xmlDocument, so would the c# memory manager
ignore this object?
I thought about replacing:
ds = myXmlDoc.DataSet;
with:
ds = myXmlDoc.DataSet.Copy();
myXmlDoc = null; //Would this allow memory to be released?
Any help on this would be appreciated.
Regards,
Steven