From: Xiang, Haihao Date: Mon, 15 Nov 2010 07:05:29 +0000 (+0800) Subject: i965_drv_video: release mfd context X-Git-Tag: libva-1.0.7~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F680%2F1;p=profile%2Fivi%2Flibva.git i965_drv_video: release mfd context Signed-off-by: Xiang, Haihao --- diff --git a/i965_drv_video/gen6_mfd.c b/i965_drv_video/gen6_mfd.c index 9da9e6d..c6fab96 100644 --- a/i965_drv_video/gen6_mfd.c +++ b/i965_drv_video/gen6_mfd.c @@ -1425,27 +1425,32 @@ gen6_mfd_terminate(VADriverContextP ctx) struct i965_media_state *media_state = &i965->media_state; struct gen6_mfd_context *gen6_mfd_context = media_state->private_context; - dri_bo_unreference(gen6_mfd_context->post_deblocking_output.bo); - gen6_mfd_context->post_deblocking_output.bo = NULL; + if (gen6_mfd_context) { + dri_bo_unreference(gen6_mfd_context->post_deblocking_output.bo); + gen6_mfd_context->post_deblocking_output.bo = NULL; - dri_bo_unreference(gen6_mfd_context->pre_deblocking_output.bo); - gen6_mfd_context->pre_deblocking_output.bo = NULL; + dri_bo_unreference(gen6_mfd_context->pre_deblocking_output.bo); + gen6_mfd_context->pre_deblocking_output.bo = NULL; - dri_bo_unreference(gen6_mfd_context->intra_row_store_scratch_buffer.bo); - gen6_mfd_context->intra_row_store_scratch_buffer.bo = NULL; + dri_bo_unreference(gen6_mfd_context->intra_row_store_scratch_buffer.bo); + gen6_mfd_context->intra_row_store_scratch_buffer.bo = NULL; - dri_bo_unreference(gen6_mfd_context->deblocking_filter_row_store_scratch_buffer.bo); - gen6_mfd_context->deblocking_filter_row_store_scratch_buffer.bo = NULL; + dri_bo_unreference(gen6_mfd_context->deblocking_filter_row_store_scratch_buffer.bo); + gen6_mfd_context->deblocking_filter_row_store_scratch_buffer.bo = NULL; - dri_bo_unreference(gen6_mfd_context->bsd_mpc_row_store_scratch_buffer.bo); - gen6_mfd_context->bsd_mpc_row_store_scratch_buffer.bo = NULL; + dri_bo_unreference(gen6_mfd_context->bsd_mpc_row_store_scratch_buffer.bo); + gen6_mfd_context->bsd_mpc_row_store_scratch_buffer.bo = NULL; - dri_bo_unreference(gen6_mfd_context->mpr_row_store_scratch_buffer.bo); - gen6_mfd_context->mpr_row_store_scratch_buffer.bo = NULL; + dri_bo_unreference(gen6_mfd_context->mpr_row_store_scratch_buffer.bo); + gen6_mfd_context->mpr_row_store_scratch_buffer.bo = NULL; - dri_bo_unreference(gen6_mfd_context->bitplane_read_buffer.bo); - gen6_mfd_context->bitplane_read_buffer.bo = NULL; + dri_bo_unreference(gen6_mfd_context->bitplane_read_buffer.bo); + gen6_mfd_context->bitplane_read_buffer.bo = NULL; + + free(gen6_mfd_context); + } + media_state->private_context = NULL; return True; }