diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 2bdb733..74db811 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -803,13 +803,15 @@ DRI2WaitSBC(ClientPtr client, DrawablePtr pDraw, CARD64 target_sbc, void DRI2DestroyDrawable(DrawablePtr pDraw) { - DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); + DRI2ScreenPtr ds; DRI2DrawablePtr pPriv; pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) return; + ds = DRI2GetScreen(pDraw->pScreen); + pPriv->refCount--; if (pPriv->refCount > 0) return;