MFC applications leak GDI objects on computers that are running Windows XP (319740)



The information in this article applies to:

  • Microsoft Windows XP Home Edition SP2
  • Microsoft Windows XP Professional SP2
  • Microsoft Windows Server 2003, Datacenter Edition
  • Microsoft Windows Server 2003, Datacenter Edition for Itanium-based Systems
  • Microsoft Windows Server 2003, Enterprise Edition
  • Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
  • Microsoft Windows Server 2003, Standard Edition
  • Microsoft Windows Server 2003, Web Edition
  • Microsoft Windows XP Home Edition
  • Microsoft Windows XP Professional

This article was previously published under Q319740

SYMPTOMS

When you run a Microsoft Foundation Classes (MFC) application on a computer that is running Microsoft Windows XP with Service Pack 2 (SP2) installed, you may see memory leaks for Graphics Device Interface (GDI) objects when you create and destroy child windows. To see the memory leaks, view the GDI objects of the process in Task Manager.

This problem also occurs on a computer that is running Windows Server 2003 when the Themes service is started. By default, the Themes service is disabled on Windows Server 2003.

CAUSE

This problem occurs because of a bug in the implementation of the new theming interface.

RESOLUTION

Hotfix information

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Windows XP or Windows Server 2003 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites

To apply this hotfix on computers that are running Windows XP, you must have Windows XP Service Pack 2 (SP2) installed on the computer. This hotfix should not be used on computers that are running Windows XP without service packs installed. This fix is not required if you are running Windows XP SP1.

Restart requirement

You must restart your computer after you apply this hotfix.

Hotfix replacement information

This hotfix does not replace any other hotfixes.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

Windows XP
   Date         Time   Version        Size     File name
   ------------------------------------------------------- 
   23-Sep-2004  17:16  6.0.2900.2523  218,624  Uxtheme.dll


Windows Server 2003 32-bit Edition:
   Date         Time   Version            Size    File name
   ----------------------------------------------------------
   18-Feb-2004  05:38  6.0.3790.274      200,704  Uxtheme.dll


Windows Server 2003 IA-64 Edition:
   Date         Time   Version            Size    File name
   ----------------------------------------------------------
   17-Feb-2004  13:38  6.0.3790.274      539,648  Uxtheme.dll IA64
   17-Feb-2004  13:38  6.0.3790.274      200,704  WUxtheme.dll X86
The following file is available for download from the Microsoft Download Center:

DownloadDownload the Update for Windows XP (KB319740) package now.
Release Date: March 21, 2006

For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to obtain Microsoft support files from online services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

WORKAROUND

If this GDI leak is seriously degrading performance, you can turn off the new user interface theming in Windows XP. To do this, follow these steps:
  1. Click Start, and then click Control Panel.
  2. Click Appearance and Themes, and then click Display.
  3. On the Themes tab of the Display Properties dialog box, click Windows Classic in the Theme list.
  4. Click Apply, and then click OK.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Modification Type:MajorLast Reviewed:3/22/2006
Keywords:kbHotfixServer kbQFE kbWinXP64Bit2003sp1fix kbWinXPsp3fix kbWinXPpreSP3fix kbbug kbfix kbshell KB319740 kbAudDeveloper