MSXML负载泄漏? [英] MSXML load leak?
问题描述
在使用MSXML加载时,我注意到程序中存在大量泄漏。调用析构函数后,我没有看到内存被释放。我该怎么做才能确保内存被释放?
我有一个简单的XML DOM类 -
CComPtr< IXMLDOMDocument> m_pDOMDoc; //头文件中定义的变量
m_pDOMDoc.CoCreateInstance(__ uuidof(DOMDocument),NULL,
CLSCTX_INPROC_SERVER); //在构造函数中调用
m_pDOMDoc-> load //在其中一个方法中使用
析构函数没有释放内存。
I notice a large leak in my program when using MSXML load. I do not see memory being released after the destructor is called. What should I do to make sure that memory gets released?
I have a simple XML DOM class -
CComPtr< IXMLDOMDocument > m_pDOMDoc; // variable defined in header file
m_pDOMDoc.CoCreateInstance( __uuidof( DOMDocument), NULL,
CLSCTX_INPROC_SERVER); // called in the constructor
..
m_pDOMDoc->load // used in one of the methods
destructor does not free up the memory.
推荐答案
以下是umdh报告的跟踪。如果有人有任何建议或解决方法,请告诉我。
+ 5020(f060 - a040)42分配BackTrace9101E5C
+ 16(42 - 2c)BackTrace9101E5C分配
77A004DE:ntdll!RtlAllocateHeap + 0000021D
728175A6:msxml3!MpHeapAlloc + 00000198
72817134:msxml3!_MemAlloc + 00000034
728170D8:msxml3!MemAllocObject + 00000013
728174E0:msxml3!ArrayString: perator new + 00000068
72817508:msxml3!ArrayString :: newString + 0000000F
72843343:msxml3!_NDNodeFactory :: bufferAttach + 00000018
72821839:msxml3!NodeFactory :: CreateNode + 000004B2
7281D093:msxml3!XMLParser :: Run + 00000692
72823955:msxml3!Document :: run + 0000007F
728238B8:msxml3!Document :: _ load + 00000185
72824446:msxml3!Document: :loadXML + 000000E3
72824305:msxml3!DOMDocumentWrapper :: loadXML + 0000004A
Below is the trace reported by umdh. Plz let me know if anyone has suggestions or workarounds.
+ 5020 ( f060 - a040) 42 allocs BackTrace9101E5C
+ 16 ( 42 - 2c) BackTrace9101E5C allocations
77A004DE : ntdll!RtlAllocateHeap+0000021D
728175A6 : msxml3!MpHeapAlloc+00000198
72817134 : msxml3!_MemAlloc+00000034
728170D8 : msxml3!MemAllocObject+00000013
728174E0 : msxml3!ArrayString:perator new+00000068
72817508 : msxml3!ArrayString::newString+0000000F
72843343 : msxml3!_NDNodeFactory::bufferAttach+00000018
72821839 : msxml3!NodeFactory::CreateNode+000004B2
7281D093 : msxml3!XMLParser::Run+00000692
72823955 : msxml3!Document::run+0000007F
728238B8 : msxml3!Document::_load+00000185
72824446 : msxml3!Document::loadXML+000000E3
72824305 : msxml3!DOMDocumentWrapper::loadXML+0000004A
这篇关于MSXML负载泄漏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!