From 66ece3bfb19642bf0f1ef73c3caa8a99c3dfb5a9 Mon Sep 17 00:00:00 2001 From: Kevin E Martin Date: Tue, 22 Sep 2009 11:42:24 +1000 Subject: dmx: only free the default pixmaps that we actually allocated. Signed-off-by: Peter Hutterer --- hw/dmx/dmxscrinit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index cab212d35..09734f56d 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -388,8 +388,11 @@ void dmxBECloseScreen(ScreenPtr pScreen) } else { /* Free the default drawables */ for (i = 0; i < dmxScreen->beNumPixmapFormats; i++) { - XFreePixmap(dmxScreen->beDisplay, dmxScreen->scrnDefDrawables[i]); - dmxScreen->scrnDefDrawables[i] = (Drawable)0; + if (dmxScreen->scrnDefDrawables[i]) { + XFreePixmap(dmxScreen->beDisplay, + dmxScreen->scrnDefDrawables[i]); + dmxScreen->scrnDefDrawables[i] = (Drawable)0; + } } } -- cgit v1.2.3