W
wh
I have a class which when instatiated creates a new XmlDocument object and
loads an xml file into it. It is used as follows:
MyObject obj = new MyObject("books.xml");
If I later have
obj = new MyObject("books2.xml");
Would all memory referenced by 'obj' (i.e. the XmlDocument) from the first
call be freed or would I be required to implement a Dispose method to
release the memory associated like:
public void Dispose()
{
m_Xml = null;
}
From what I can make out, as XmlDocument is a managed resource (with no
explicit Dispose() or Close() method) it will automatically be deallocated.
Wayne.
loads an xml file into it. It is used as follows:
MyObject obj = new MyObject("books.xml");
If I later have
obj = new MyObject("books2.xml");
Would all memory referenced by 'obj' (i.e. the XmlDocument) from the first
call be freed or would I be required to implement a Dispose method to
release the memory associated like:
public void Dispose()
{
m_Xml = null;
}
From what I can make out, as XmlDocument is a managed resource (with no
explicit Dispose() or Close() method) it will automatically be deallocated.
Wayne.