diff options
author | Keith Packard <keithp@keithp.com> | 2010-07-01 09:56:40 -0400 |
---|---|---|
committer | Owain G. Ainsworth <oga@openbsd.org> | 2010-09-03 23:21:42 +0100 |
commit | 5c8e1651d72ed2e7bbf59abbf98712d746e8cbe7 (patch) | |
tree | fa7cedef494950a894a0149b5a3ae412b45d21ea /uxa | |
parent | e792898d2888a0c272aa0e334705ea343f381017 (diff) |
Destroy screen pixmap on screen close.
This avoids a memory leak on server reset.
Signed-off-by: Keith Packard <keithp@keithp.com>
[ickle: Added comments from Keith that explain the necessity of
destroying the pixmap ourselves and why chaining up in this instance is
not the correct approach.]
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit e30f0338fbf894fa3fdab20f4f9a97495cd341da)
Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
Diffstat (limited to 'uxa')
-rw-r--r-- | uxa/uxa.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1,7 +1,7 @@ /* - * Copyright © 2001 Keith Packard + * Copyright © 2001 Keith Packard * - * Partly based on code that is Copyright © The XFree86 Project Inc. + * Partly based on code that is Copyright © The XFree86 Project Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -378,6 +378,13 @@ static Bool uxa_close_screen(int i, ScreenPtr pScreen) uxa_glyphs_fini(pScreen); + /* Destroy the pixmap created by miScreenInit() *before* chaining up as + * we finalize ourselves here and so this is the last chance we have of + * releasing our resources associated with the Pixmap. So do it first. + */ + (void) (*pScreen->DestroyPixmap) (pScreen->devPrivate); + pScreen->devPrivate = NULL; + pScreen->CreateGC = uxa_screen->SavedCreateGC; pScreen->CloseScreen = uxa_screen->SavedCloseScreen; pScreen->GetImage = uxa_screen->SavedGetImage; |