[PATCH 3/7] Use FreePixmap to free the fbPixmap in case the driver forgot

Keith Packard keithp at keithp.com
Wed May 12 14:45:07 PDT 2010


If the driver fails to free the screen pixmap in its CloseScreen
function, fb is about the only place available. This probably
shouldn't be done though; it won't clean up the pixmap correctly.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 fb/fbscreen.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index 9b789b0..c554026 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -37,6 +37,10 @@ fbCloseScreen (int index, ScreenPtr pScreen)
     free(depths);
     free(pScreen->visuals);
     free(pScreen->devPrivate);
+    if (pScreen->devPrivate) {
+	FreePixmap(pScreen->devPrivate);
+	pScreen->devPrivate = NULL;
+    }
 #ifdef FB_SCREEN_PRIVATE
     free(dixLookupPrivate(&pScreen->devPrivates, fbGetScreenPrivateKey()));
 #endif
-- 
1.7.1



More information about the xorg-devel mailing list