From db86b8839f286e0e2efb5638b8ab2fe608707655 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 8 Jul 2008 15:12:45 +0930 Subject: [PATCH] dix: free GenericMask allocations when destroying window. --- dix/window.c | 13 +++++++++++++ include/windowstr.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dix/window.c b/dix/window.c index 541d19902..a780d64c7 100644 --- a/dix/window.c +++ b/dix/window.c @@ -822,6 +822,8 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, static void DisposeWindowOptional (WindowPtr pWin) { + GenericMaskPtr gmask = NULL, next = NULL; + if (!pWin->optional) return; /* @@ -855,6 +857,17 @@ DisposeWindowOptional (WindowPtr pWin) xfree(pWin->optional->access.perm); xfree(pWin->optional->access.deny); + /* Remove generic event mask allocations */ + if (pWin->optional->geMasks) + gmask = pWin->optional->geMasks->geClients; + while(gmask) + { + next = gmask->next; + xfree(gmask); + gmask = next; + } + xfree (pWin->optional->geMasks); + xfree (pWin->optional); pWin->optional = NULL; } diff --git a/include/windowstr.h b/include/windowstr.h index 0e45262d8..2d11f6ec7 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -115,7 +115,7 @@ typedef struct _WindowOpt { #endif struct _OtherInputMasks *inputMasks; /* default: NULL */ DevCursorList deviceCursors; /* default: NULL */ - struct _GenericClientMasks *geMasks;/* default: NULL */ + struct _GenericClientMasks *geMasks; /* default: NULL */ WindowAccessRec access; } WindowOptRec, *WindowOptPtr;