}
/* Dereference the palettes */
- PALETTE_ShareUnlockPalette(pebo->ppalSurf);
- PALETTE_ShareUnlockPalette(pebo->ppalDC);
- if (pebo->ppalDIB) PALETTE_ShareUnlockPalette(pebo->ppalDIB);
+ if (pebo->ppalSurf)
+ {
+ PALETTE_ShareUnlockPalette(pebo->ppalSurf);
+ }
+ if (pebo->ppalDC)
+ {
+ PALETTE_ShareUnlockPalette(pebo->ppalDC);
+ }
+ if (pebo->ppalDIB)
+ {
+ PALETTE_ShareUnlockPalette(pebo->ppalDIB);
+ }
}
VOID
/* Insert the object */
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");
GDIOBJ_vFreeObject(&pdc->BaseObject);
return NULL;
EBRUSHOBJ_vCleanup(&pdc->eboBackground);
/* Release font */
- LFONT_ShareUnlockFont(pdc->dclevel.plfnt);
+ if (pdc->dclevel.plfnt)
+ LFONT_ShareUnlockFont(pdc->dclevel.plfnt);
/* Free regions */
if (pdc->dclevel.prgnClip)
pdc->dclevel.hPath = 0;
pdc->dclevel.flPath = 0;
}
- if(pdc->dclevel.pSurface)
+ if (pdc->dclevel.pSurface)
SURFACE_ShareUnlockSurface(pdc->dclevel.pSurface);
- PDEVOBJ_vRelease(pdc->ppdev);
+ if (pdc->ppdev)
+ PDEVOBJ_vRelease(pdc->ppdev);
}
VOID