Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Memory leak when you use an enumerator object in an application for Internet Explorer 10


View products that this article applies to.

Symptoms

Consider the following scenario:
  • You develop a web browser control host application or an ActiveX control.
  • The application or ActiveX control references the enumerator object from a collection interface of an HTML page. To create this functionality, see the following guidelines:
    • In C++, the enumerator is obtained by calling the get__newEnum function of a collection interface.  An example of a collection interface is IHTMLElementCollection, and this is usually obtained by calling IHTMLDocument2::get_all.
    • In Visual Basic, this step is performed behind the scenes in a foreach construct over a collection (for example, the document.all collection). 
  • You run the application on a computer that has Internet Explorer 10 installed.
In this scenario, a memory leak occurs.

Note Because ActiveX controls consume more memory than native HTML elements, the memory leak is more obvious if one of the elements in the collection is an ActiveX control.

For example, a memory leak occurs when you use the following C++ code in a function of a web browser control host application. In this situation, a large volume of memory is leaked if one of the elements on the webpage is an ActiveX control.
void CEnumLeakDlg::OnBnClicked()
{
IDispatch* pDocDisp = m_web.get_Document();
IHTMLDocument2* pDoc = NULL;
HRESULT hr = pDocDisp->QueryInterface(IID_IHTMLDocument2, (void**)&pDoc);
IHTMLElementCollection* pElColl = NULL;
hr = pDoc->get_all(&pElColl);
IUnknown* pEnum = NULL;
hr = pElColl->get__newEnum(&pEnum);
pEnum->Release();
pElColl->Release();
pDoc->Release();
pDocDisp->Release();
}

↑ Back to the top


Resolution

To resolve this issue, install the following update:
2862772 MS13-059: Cumulative security update for Internet Explorer: August 13, 2013

↑ Back to the top


More Information

For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates

↑ Back to the top


Keywords: kbqfe, kbfix, kbexpertiseadvanced, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 2880281
Revision : 1
Created on : 1/7/2017
Published on : 10/12/2013
Exists online : False
Views : 214