The information in this article applies to:
SYMPTOMSWhen using the CMap template class, users may notice a memory leak when using non-primitive objects as KEY values (for example, CString). CAUSEThe CMap class does not call the destructor for its KEYs when it does a RemoveAll(). RESOLUTIONBecause the CMap class is implemented in AFXTEMPL.H, users can add a single line to the CMap::RemoveAll() member function in this file to correct this problem. The new line is marked with a //NOTE: in the following code:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in the Microsoft Foundation Classes version 3.1 included with Microsoft Visual C++, 32-bit Edition, version 2.1. Additional query words: CString CMap 3.00 KEY 2.00
Keywords : kbcode kbnokeyword kbMFC kbVC |
Last Reviewed: September 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |