FIX: Using Run-Time Type Info May Cause Memory Leak Report (140670)
The information in this article applies to:
- Microsoft Visual C++ 4.0
- Microsoft Visual C++ 4.1
This article was previously published under Q140670 SYMPTOMS
When 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.
CAUSE
When 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.
RESOLUTION
The reported memory leak can be ignored.
STATUS
Microsoft 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.
Modification Type: | Major | Last Reviewed: | 10/17/2003 |
---|
Keywords: | kbbug kbCRT kbfix KB140670 |
---|
|