[PATCH] midispcur: Add comment explaining why pRootPicture must not be freed.

Jamey Sharp jamey at minilop.net
Thu May 27 12:06:28 PDT 2010


Signed-off-by: Jamey Sharp <jamey at minilop.net>
Cc: Peter Hutterer <peter.hutterer at who-t.net>
---
On Thu, May 27, 2010 at 1:38 AM, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> this comment seems a bit odd. is this part of another patch?

Yeah, it should have been. This patch only makes sense after deleting
the MoveCursor code though; otherwise, it ought to explicitly free
pTempPicture as well, except that we know that can't be anything but
NULL.

 mi/midispcur.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/mi/midispcur.c b/mi/midispcur.c
index 59923c8..c279010 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -569,6 +569,12 @@ miDCDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
                 if (pBuffer->pSaveGC) FreeGC(pBuffer->pSaveGC, (GContext) 0);
                 if (pBuffer->pRestoreGC) FreeGC(pBuffer->pRestoreGC, (GContext) 0);
 
+#ifdef ARGB_CURSOR
+                /* If a pRootPicture was allocated for a root window, it
+                 * is freed when that root window is destroyed, so don't
+                 * free it again here. */
+#endif
+
                 if (pBuffer->pSave) (*pScreen->DestroyPixmap)(pBuffer->pSave);
 
                 free(pBuffer);
-- 
1.7.0



More information about the xorg-devel mailing list