Microsoft KB Archive/319488

= Memory Leak in Windows CE Platform SDK for Handheld PC 2000 HTMLVIEW Sample =

Article ID: 319488

Article Last Modified on 10/20/2003

-

APPLIES TO


 * Microsoft Windows CE Platform Software Development Kit 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 &quot;\Windows CE Tools\Wce300\Hpc2000\Samples\Win32\Htmlview&quot; 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; }



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Keywords: kbenv kbprb KB319488

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.