From 2f245af009d6ba1fadb84bd78f397cabd3b9cb58 Mon Sep 17 00:00:00 2001
From: Huw D M Davies <hdavies@codeweavers.com>
Date: Tue, 12 Sep 2000 23:38:33 +0000
Subject: [PATCH] Don't try to delete a wndclass background brush if it's a
 COLOR_* constant.

---
 windows/class.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/windows/class.c b/windows/class.c
index d7a11555f66..2ea116120c6 100644
--- a/windows/class.c
+++ b/windows/class.c
@@ -240,7 +240,7 @@ static void CLASS_SetClassNameW( CLASS *classPtr, LPCWSTR name )
 static BOOL CLASS_FreeClass( CLASS *classPtr )
 {
     CLASS **ppClass;
-    TRACE("%p \n", classPtr);  
+    TRACE("%p\n", classPtr);  
 
     /* Check if we can remove this class */
 
@@ -260,7 +260,8 @@ static BOOL CLASS_FreeClass( CLASS *classPtr )
     /* Delete the class */
 
     if (classPtr->dce) DCE_FreeDCE( classPtr->dce );
-    if (classPtr->hbrBackground) DeleteObject( classPtr->hbrBackground );
+    if (classPtr->hbrBackground > (HBRUSH)(COLOR_GRADIENTINACTIVECAPTION + 1))
+        DeleteObject( classPtr->hbrBackground );
     GlobalDeleteAtom( classPtr->atomName );
     CLASS_SetMenuNameA( classPtr, NULL );
     CLASS_SetClassNameA( classPtr, NULL );
@@ -277,7 +278,7 @@ void CLASS_FreeModuleClasses( HMODULE16 hModule )
 {
     CLASS *ptr, *next;
   
-    TRACE("0x%08x \n", hModule);  
+    TRACE("0x%08x\n", hModule); 
 
     for (ptr = firstClass; ptr; ptr = next)
     {
-- 
GitLab