The information in this article applies to:
SYMPTOMSAn application that statically links to MFC and uses one of the C++ I/O functions (cout, cin, cerr, or clog) generates memory leak messages when it exits from the program. The messages look similar to this one:
The second line indicates a loss of 84 bytes for 32-bit editions and 28
bytes for 16-bit editions of Visual C++.
CAUSE
By referencing cout, cin, cerr, or clog you are causing these objects to do
a one-time allocation for their file-buffer objects. The file-buffer
objects are allocated using "operator new," and when you use MFC, these
allocations are mapped through MFC's debug allocator (an overridden version
of "operator new" that can be found in \MSVC\MFC\SRC\AFXMEM.CPP). There is
also a memory buffer 512 bytes long allocated by the Run-Time library. RESOLUTIONThese memory leaks can be safely ignored. The memory is correctly freed by the Run-Time Library. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was fixed in Microsoft Visual C++, 32-bit Edition, version 4.0. Additional query words: 1.00 1.50 2.50 1.51 2.51 1.52 2.52 1.10 2.10 2.00 3.00 2.10 3.10
Keywords : kbnokeyword kbMFC kbVC |
Last Reviewed: July 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |