Memory Leak in Windows CE Platform SDK for Handheld PC 2000 HTMLVIEW Sample (319488)
The information in this article applies to:
- Microsoft Windows CE Platform SDK for Handheld PC 2000
This article was previously published under Q319488 SYMPTOMS
The HTMLVIEW sample program that is included with the Windows CE Platform SDK for Handheld PC 2000 and that is installed to the "\Windows CE Tools\Wce300\Hpc2000\Samples\Win32\Htmlview" folder leaks memory when you use the Browse command on the File menu to open a new file.
CAUSE
This problem may occur because the HTMLVIEW sample code in the OpenBrowseFile function allocates memory to store the current folder location in line 513 of the Htmlview.cpp file. The pCurrentDirectory variable is assigned a pointer to the memory that is allocated. The allocated memory is only freed if the user cancels the open request.
RESOLUTION
To correct this sample error, add the following code before the OpenBrowseFile function returns pFileName in line 547 of the Htmlview.cpp file:
if (pCurrentDirectory)
{
HeapFree(hHeap, HEAP_NO_SERIALIZE, pCurrentDirectory);
pCurrentDirectory = NULL;
}
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 10/20/2003 |
---|
Keywords: | kbenv kbprb KB319488 |
---|
|