[Home] [By Thread] [By Date] [Recent Entries]

  • From: gramanan@e...
  • To: xml-dev@l...
  • Date: Thu, 28 Jun 2001 16:18:49 -0700

Hi All,

  I'm experiencing a memory leak of ~8K when I use the
IXMLDOMNode::selectSingleNode method. I've provided the code snippet below. 

CComPtr<IXMLDOMNode> spResultNode = NULL;
HRESULT hr;
	
#ifdef XMLUSEIMPORTLIB

	hr = pCurrentCursorNode->raw_selectSingleNode(wstrPattern,
&spResultNode);
#else
	if(FAILED(pCurrentCursorNode->selectSingleNode(wstrPattern,
&spResultNode)) ) 
		return XMLInternalCOMError;
#endif

I'm using the MSXML 2.5 parser [msxml.dll version : 8.00.5226.0]. I suspect
the memory leak is because spResultNode doesn't get deallocated even after
it goes out of scope. 

Can someone tell me what I'm doing wrong? I tried using IXMLDOMNode *
instead of the smart pointer. that didn't help either. I do hope there's
someone out there who can help me.

thanks,
Gayatri

 

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member