From 7db2f3af0f8e6023f96b1e0121cc95c12b1db525 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Fri, 17 Feb 2017 13:13:36 +0000 Subject: [PATCH] [WIN32K] - The pattern bitmap can get deleted during the GDI cleanup for process before the brush itself. - Gets rid of some of those pesky "GreDeleteObject: Trying to delete invalid object" debug prints. svn path=/trunk/; revision=73812 --- reactos/win32ss/gdi/ntgdi/brush.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/brush.cpp b/reactos/win32ss/gdi/ntgdi/brush.cpp index 210297693c0..5671324bbe5 100644 --- a/reactos/win32ss/gdi/ntgdi/brush.cpp +++ b/reactos/win32ss/gdi/ntgdi/brush.cpp @@ -62,8 +62,8 @@ BRUSH::~BRUSH( GdiPoolFree(GetBrushAttrPool(), this->pBrushAttr); } - /* Delete the pattern bitmap */ - if (this->hbmPattern != NULL) + /* Delete the pattern bitmap (may have already been deleted during gdi cleanup) */ + if (this->hbmPattern != NULL && GreIsHandleValid(this->hbmPattern)) { GreSetBitmapOwner(this->hbmPattern, BASEOBJECT::OWNER::POWNED); GreDeleteObject(this->hbmPattern); -- 2.17.1