BUG: Memory Leaks When Using Bitmaps in Visual C++ Macintosh 4.0b 68K Applications (199540)
The information in this article applies to:
- Microsoft Visual C++, Macintosh Cross-Development Addon 4.0b
This article was previously published under Q199540 SYMPTOMS
When selecting a bitmap into a device context, SelectObject may return NULL.
CAUSE
When a bitmap is deleted, the memory allocated for it is not released from the application heap space. This problem occurs only for bitmaps that are not read-only (see SetBitmapReadOnly) and only with 68K applications developed using Visual C++ for Macintosh 4.0b.
RESOLUTION
Following are five different resolutions:
- Set the bitmaps as read-only using SetBitmapReadOnly(hBitmap, BRO_READONLY) before selecting them into the DC.
- Reuse the same bitmap object.
- Develop using Visual C++ for Macintosh 4.0.
- Call the undocumented internal function _FreeGWorldCache().
- Increase memory requirements.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. REFERENCES
(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Adam Kim, Microsoft Corporation.
Modification Type: | Major | Last Reviewed: | 10/16/2002 |
---|
Keywords: | kbBug kbDSupport kbgraphic KB199540 |
---|
|