The information in this article applies to:
SYMPTOMSWhen exiting a debug application that uses run-time type information (RTTI) and calls the 'name' member function of the type_info class, Visual C++ reports "Detected memory leaks!" in the output window. CAUSEWhen you call the 'name' member function of the type_info class, it incorrectly allocates a _NORMAL_BLOCK buffer to hold the type name. This can cause a memory leak to be reported incorrectly when you run a debug version of the program. RESOLUTIONThe reported memory leak can be ignored. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++, 32-bit Edition, version 4.2. MORE INFORMATIONWhen you call the 'name' member function of the type_info and then later call _CrtDumpMemoryLeaks, memory leaks are incorrectly reported. The following sample code demonstrates the problem. Sample Code
You would see messages similar to the following in the debug tab of the
output window:
NOTE: If you are using the 'name' member function within an MFC application, the leaks will be reported even if you do not explicitly call _CrtDumpMemoryLeaks. MFC calls this function automatically when the application terminates. Additional query words: kbVC400bug 4.00 4.10 vcfixlist420
Keywords : kbCRT kbVC |
Last Reviewed: July 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |