Index: mi/midispcur.c =================================================================== RCS file: /cvs/fd/xorg/xc/programs/Xserver/mi/midispcur.c,v retrieving revision 1.5 diff -u -r1.5 midispcur.c --- mi/midispcur.c 21 Aug 2005 19:29:55 -0000 1.5 +++ mi/midispcur.c 25 Aug 2005 22:17:25 -0000 @@ -112,6 +112,15 @@ miDCChangeSave, }; +Bool +miDCIsRootPicture(ScreenPtr pScreen, PicturePtr pPicture) +{ + miDCScreenPtr pScreenPriv + = (miDCScreenPtr) pScreen->devPrivates[miDCScreenIndex].ptr;; + + return (pScreenPriv->pRootPicture == pPicture); +} + Bool miDCInitialize (pScreen, screenFuncs) ScreenPtr pScreen; @@ -184,6 +193,7 @@ tossPix (pScreenPriv->pSave); tossPix (pScreenPriv->pTemp); #ifdef ARGB_CURSOR + ErrorF("tossPict %p %d\n", pScreenPriv->pRootPicture, pScreenPriv->pRootPicture->refcnt); tossPict (pScreenPriv->pRootPicture); tossPict (pScreenPriv->pTempPicture); #endif @@ -481,8 +491,11 @@ #ifdef ARGB_CURSOR if (pPriv->pPicture) { + ErrorF("pRootPicture0: %p\n", pScreenPriv->pRootPicture); if (!EnsurePicture(pScreenPriv->pRootPicture, &pWin->drawable, pWin)) return FALSE; + ErrorF("pRootPicture: %p %d\n", pScreenPriv->pRootPicture, + pScreenPriv->pRootPicture->refcnt); CompositePicture (PictOpOver, pPriv->pPicture, NULL, Index: render/picture.c =================================================================== RCS file: /cvs/fd/xorg/xc/programs/Xserver/render/picture.c,v retrieving revision 1.18 diff -u -r1.18 picture.c --- render/picture.c 13 Jul 2005 16:30:53 -0000 1.18 +++ render/picture.c 25 Aug 2005 22:17:25 -0000 @@ -101,6 +101,8 @@ } +extern Bool miDCIsRootPicture(ScreenPtr, PicturePtr); + Bool PictureDestroyWindow (WindowPtr pWindow) { @@ -112,6 +114,8 @@ while ((pPicture = GetPictureWindow(pWindow))) { SetPictureWindow(pWindow, pPicture->pNext); + if (miDCIsRootPicture(pScreen, pPicture)) + ErrorF("Freeing RootPicture\n"); if (pPicture->id) FreeResource (pPicture->id, PictureType); FreePicture ((pointer) pPicture, pPicture->id);