Any help from any COM experts out there would be gratefully received.
I am debugging a server application which steadily increases the applications Handle Count at a rate that would cause problems for the server machine after approx 1 week.
One area which appears to be a problem is in a Class contructor which contains the following code:
CANCXMLBase::CANCXMLBase(CLogBase *pLogIn)
{
// ...
hr=CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument, (void**)&m_xml_doc);
// ...
}
Each time the object is instantiated it goes through the CoCreateInstance code and increments the handle count by 4.
The destructor is as follows:
CANCXMLBase::~CANCXMLBase()
{
if(m_xml_doc)
{
ReleaseIt(m_node_error);
m_xml_doc->Release();
m_xml_doc=NULL;
}
}
After the destructor call the handle count remains +4 and never seems to reduce.
Am I wrong in thinking that the m_xml_doc->Release() should release resources allocated in the CoCreateInstance call?
Incidentally I am viewing the handle count through Task Manager.
Thanks for reading.
I am debugging a server application which steadily increases the applications Handle Count at a rate that would cause problems for the server machine after approx 1 week.
One area which appears to be a problem is in a Class contructor which contains the following code:
CANCXMLBase::CANCXMLBase(CLogBase *pLogIn)
{
// ...
hr=CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,
IID_IXMLDOMDocument, (void**)&m_xml_doc);
// ...
}
Each time the object is instantiated it goes through the CoCreateInstance code and increments the handle count by 4.
The destructor is as follows:
CANCXMLBase::~CANCXMLBase()
{
if(m_xml_doc)
{
ReleaseIt(m_node_error);
m_xml_doc->Release();
m_xml_doc=NULL;
}
}
After the destructor call the handle count remains +4 and never seems to reduce.
Am I wrong in thinking that the m_xml_doc->Release() should release resources allocated in the CoCreateInstance call?
Incidentally I am viewing the handle count through Task Manager.
Thanks for reading.