---
 src/gallium/state_trackers/dri/dri_context.c |    5 +++++
 src/gallium/state_trackers/dri/dri_screen.c  |   10 ++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/gallium/state_trackers/dri/dri_context.c 
b/src/gallium/state_trackers/dri/dri_context.c
index f2e5f3f..cfb0f0b 100644
--- a/src/gallium/state_trackers/dri/dri_context.c
+++ b/src/gallium/state_trackers/dri/dri_context.c
@@ -101,6 +101,11 @@ dri_destroy_context(__DRIcontext * cPriv)
 {
    struct dri_context *ctx = dri_context(cPriv);
 
+   /* note: we are freeing values and nothing more because
+      driParseConfigFiles allocated values only - the rest
+      is owned by screen optionCache */
+   FREE(ctx->optionCache.values);
+
    /* No particular reason to wait for command completion before
     * destroying a context, but it is probably worthwhile flushing it
     * to avoid having to add code elsewhere to cope with flushing a
diff --git a/src/gallium/state_trackers/dri/dri_screen.c 
b/src/gallium/state_trackers/dri/dri_screen.c
index 793db08..8fe2596 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -323,8 +323,18 @@ static void
 dri_destroy_screen(__DRIscreen * sPriv)
 {
    struct dri_screen *screen = dri_screen(sPriv);
+   int i;
 
    screen->pipe_screen->destroy(screen->pipe_screen);
+   
+   for (i = 0; i < (1 << screen->optionCache.tableSize); ++i) {
+       FREE(screen->optionCache.info[i].name);
+       FREE(screen->optionCache.info[i].ranges);
+   }
+
+   FREE(screen->optionCache.info);
+   FREE(screen->optionCache.values);
+
    FREE(screen);
    sPriv->private = NULL;
 }
-- 
1.6.6


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to