[Mesa-dev] [PATCH 1/4] st/va: added some calls to handle_table_remove()

Leo Liu leo.liu at amd.com
Mon Nov 17 07:46:01 PST 2014


From: Michael Varga <Michael.Varga at amd.com>

In a few locations handles were being added but not removed.

Signed-off-by: Michael Varga <Michael.Varga at amd.com>
---
 src/gallium/state_trackers/va/buffer.c  | 1 +
 src/gallium/state_trackers/va/context.c | 1 +
 src/gallium/state_trackers/va/image.c   | 1 +
 3 files changed, 3 insertions(+)

diff --git a/src/gallium/state_trackers/va/buffer.c b/src/gallium/state_trackers/va/buffer.c
index 4023c32..8f9ba44 100644
--- a/src/gallium/state_trackers/va/buffer.c
+++ b/src/gallium/state_trackers/va/buffer.c
@@ -131,6 +131,7 @@ vlVaDestroyBuffer(VADriverContextP ctx, VABufferID buf_id)
 
    FREE(buf->data);
    FREE(buf);
+   handle_table_remove(VL_VA_DRIVER(ctx)->htab, buf_id);
 
    return VA_STATUS_SUCCESS;
 }
diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index ae87d3b..a7a55f9 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -212,6 +212,7 @@ vlVaDestroyContext(VADriverContextP ctx, VAContextID context_id)
    }
    context->decoder->destroy(context->decoder);
    FREE(context);
+   handle_table_remove(drv->htab, context_id);
 
    return VA_STATUS_SUCCESS;
 }
diff --git a/src/gallium/state_trackers/va/image.c b/src/gallium/state_trackers/va/image.c
index cd4044a..a30155e 100644
--- a/src/gallium/state_trackers/va/image.c
+++ b/src/gallium/state_trackers/va/image.c
@@ -171,6 +171,7 @@ vlVaDestroyImage(VADriverContextP ctx, VAImageID image)
    if (!vaimage)
       return VA_STATUS_ERROR_INVALID_IMAGE;
 
+   handle_table_remove(VL_VA_DRIVER(ctx)->htab, image);
    return vlVaDestroyBuffer(ctx, vaimage->buf);
 }
 
-- 
1.9.1



More information about the mesa-dev mailing list