mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 09:24:11 +00:00
[WIN32K]
- Check for null members when cleaning up DCs and brushes. Fixes crashes in some failure cases when running out of GDI handles. CORE-13155 svn path=/trunk/; revision=74435
This commit is contained in:
parent
a526c712b5
commit
adae348b32
|
@ -175,9 +175,18 @@ EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dereference the palettes */
|
/* Dereference the palettes */
|
||||||
PALETTE_ShareUnlockPalette(pebo->ppalSurf);
|
if (pebo->ppalSurf)
|
||||||
PALETTE_ShareUnlockPalette(pebo->ppalDC);
|
{
|
||||||
if (pebo->ppalDIB) PALETTE_ShareUnlockPalette(pebo->ppalDIB);
|
PALETTE_ShareUnlockPalette(pebo->ppalSurf);
|
||||||
|
}
|
||||||
|
if (pebo->ppalDC)
|
||||||
|
{
|
||||||
|
PALETTE_ShareUnlockPalette(pebo->ppalDC);
|
||||||
|
}
|
||||||
|
if (pebo->ppalDIB)
|
||||||
|
{
|
||||||
|
PALETTE_ShareUnlockPalette(pebo->ppalDIB);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -91,7 +91,6 @@ DC_AllocDcWithHandle(GDILOOBJTYPE eDcObjType)
|
||||||
/* Insert the object */
|
/* Insert the object */
|
||||||
if (!GDIOBJ_hInsertObject(&pdc->BaseObject, GDI_OBJ_HMGR_POWNED))
|
if (!GDIOBJ_hInsertObject(&pdc->BaseObject, GDI_OBJ_HMGR_POWNED))
|
||||||
{
|
{
|
||||||
/// FIXME: this is broken, since the DC is not initialized yet...
|
|
||||||
DPRINT1("Could not insert DC into handle table.\n");
|
DPRINT1("Could not insert DC into handle table.\n");
|
||||||
GDIOBJ_vFreeObject(&pdc->BaseObject);
|
GDIOBJ_vFreeObject(&pdc->BaseObject);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -370,7 +369,8 @@ DC_vCleanup(PVOID ObjectBody)
|
||||||
EBRUSHOBJ_vCleanup(&pdc->eboBackground);
|
EBRUSHOBJ_vCleanup(&pdc->eboBackground);
|
||||||
|
|
||||||
/* Release font */
|
/* Release font */
|
||||||
LFONT_ShareUnlockFont(pdc->dclevel.plfnt);
|
if (pdc->dclevel.plfnt)
|
||||||
|
LFONT_ShareUnlockFont(pdc->dclevel.plfnt);
|
||||||
|
|
||||||
/* Free regions */
|
/* Free regions */
|
||||||
if (pdc->dclevel.prgnClip)
|
if (pdc->dclevel.prgnClip)
|
||||||
|
@ -394,10 +394,11 @@ DC_vCleanup(PVOID ObjectBody)
|
||||||
pdc->dclevel.hPath = 0;
|
pdc->dclevel.hPath = 0;
|
||||||
pdc->dclevel.flPath = 0;
|
pdc->dclevel.flPath = 0;
|
||||||
}
|
}
|
||||||
if(pdc->dclevel.pSurface)
|
if (pdc->dclevel.pSurface)
|
||||||
SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface);
|
SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface);
|
||||||
|
|
||||||
PDEVOBJ_vRelease(pdc->ppdev);
|
if (pdc->ppdev)
|
||||||
|
PDEVOBJ_vRelease(pdc->ppdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
Loading…
Reference in a new issue