[WIN32K]
authorkhornicek <khornicek@97493ccd-5924-5043-b1f5-66cb403b36ce>
Fri, 17 Feb 2017 13:13:36 +0000 (13:13 +0000)
committerkhornicek <khornicek@97493ccd-5924-5043-b1f5-66cb403b36ce>
Fri, 17 Feb 2017 13:13:36 +0000 (13:13 +0000)
- 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.

git-svn-id: file:///srv/svn/reactos/trunk@73812 97493ccd-5924-5043-b1f5-66cb403b36ce

reactos/win32ss/gdi/ntgdi/brush.cpp

index 2102976..5671324 100644 (file)
@@ -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);