Don't try to delete a wndclass background brush if it's a COLOR_* constant.
diff --git a/windows/class.c b/windows/class.c index d7a1155..2ea1161 100644 --- a/windows/class.c +++ b/windows/class.c
@@ -240,7 +240,7 @@ 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 @@ /* 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 @@ { CLASS *ptr, *next; - TRACE("0x%08x \n", hModule); + TRACE("0x%08x\n", hModule); for (ptr = firstClass; ptr; ptr = next) {