BUG: Caching GDI Objects Causes Temporary GDI Resource LeakLast reviewed: January 5, 1995Article ID: Q118471 |
The information in this article applies to:
SYMPTOMSThe amount of free GDI resources decreases as an application prints, especially over the course of several print jobs. NOTE: The information in this article also applies to the screen; however, this issue more often impacts applications when printing, and therefore that is the specific subject of this article.
CAUSEThe application caches GDI objects by creating them and not deleting them until the application terminates. Those objects are selected in and out of a printer device context (DC) when needed, over the course of several print jobs. GDI creates a new physical object structure for each logical object that is selected into a printer DC. New physical objects are created even if the same logical objects are selected into a different printer DC. Those physical objects are not deleted until the corresponding logical objects are deleted. The more objects used in printing, and the more jobs that are printed using those objects, the more physical objects are created and more GDI resources are used up.
RESOLUTIONDo not cache GDI objects (such as pens, brushes, and fonts). Instead, create them, use them during printing, and then delete them after each print job.
STATUSMicrosoft has confirmed this to be a bug in Microsoft Windows version 3.1. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThis problem can be reproduced as follows:
|
Additional reference words: buglist3.10 3.10 buglist3.10 system resources
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |