diff --git a/windows/class.c b/windows/class.c index 2be09d9dc68..ddc7cb6edd5 100644 --- a/windows/class.c +++ b/windows/class.c @@ -409,7 +409,7 @@ static BOOL CLASS_UnregisterClass( ATOM atom, HINSTANCE hInstance ) USER_Lock(); if (atom && (classPtr = CLASS_FindClassByAtom( atom, hInstance )) && - (classPtr->hInstance == hInstance)) + (!hInstance || classPtr->hInstance == hInstance)) { ret = CLASS_FreeClass( classPtr ); }