From: gb Date: Wed, 24 Mar 2010 14:57:33 +0000 (+0000) Subject: Fix destruction order of subpictures. They should be destroyed first. X-Git-Tag: accepted/trunk/20120822.173359~612 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8ec5043435be1020db30ddcc170908746b4eaa7;p=profile%2Fivi%2Fgstreamer-vaapi.git Fix destruction order of subpictures. They should be destroyed first. --- diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index bd35504..364a51c 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.c +++ b/gst-libs/gst/vaapi/gstvaapisurface.c @@ -71,6 +71,12 @@ gst_vaapi_surface_destroy(GstVaapiSurface *surface) surface_id = GST_VAAPI_OBJECT_ID(surface); GST_DEBUG("surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS(surface_id)); + if (priv->subpictures) { + g_ptr_array_foreach(priv->subpictures, destroy_subpicture_cb, NULL); + g_ptr_array_free(priv->subpictures, TRUE); + priv->subpictures = NULL; + } + if (surface_id != VA_INVALID_SURFACE) { GST_VAAPI_DISPLAY_LOCK(display); status = vaDestroySurfaces( @@ -83,12 +89,6 @@ gst_vaapi_surface_destroy(GstVaapiSurface *surface) GST_VAAPI_ID_ARGS(surface_id)); GST_VAAPI_OBJECT_ID(surface) = VA_INVALID_SURFACE; } - - if (priv->subpictures) { - g_ptr_array_foreach(priv->subpictures, destroy_subpicture_cb, NULL); - g_ptr_array_free(priv->subpictures, TRUE); - priv->subpictures = NULL; - } } static gboolean