From: Justin Kim Date: Tue, 31 May 2016 09:58:43 +0000 (+0900) Subject: ahcsrc: release resources in 'finalize' function X-Git-Tag: 1.10.4~652 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe62233b83840ae738871ef78d7dd814de8690ca;p=platform%2Fupstream%2Fgst-plugins-bad.git ahcsrc: release resources in 'finalize' function In general, 'dispose' function is used for dropping all references and 'finalize' is called for releasing instances. https://bugzilla.gnome.org/show_bug.cgi?id=763309 --- diff --git a/sys/androidmedia/gstahcsrc.c b/sys/androidmedia/gstahcsrc.c index 7162dcb..33d79be 100644 --- a/sys/androidmedia/gstahcsrc.c +++ b/sys/androidmedia/gstahcsrc.c @@ -81,7 +81,7 @@ static void gst_ahc_src_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_ahc_src_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_ahc_src_dispose (GObject * object); +static void gst_ahc_src_finalize (GObject * object); /* GstElement */ static GstStateChangeReturn gst_ahc_src_change_state (GstElement * element, @@ -272,7 +272,7 @@ gst_ahc_src_class_init (GstAHCSrcClass * klass) gobject_class->set_property = gst_ahc_src_set_property; gobject_class->get_property = gst_ahc_src_get_property; - gobject_class->dispose = gst_ahc_src_dispose; + gobject_class->finalize = gst_ahc_src_finalize; element_class->change_state = gst_ahc_src_change_state; @@ -558,17 +558,14 @@ gst_ahc_src_init (GstAHCSrc * self) } static void -gst_ahc_src_dispose (GObject * object) +gst_ahc_src_finalize (GObject * object) { GstAHCSrc *self = GST_AHC_SRC (object); - if (self->queue) - g_object_unref (self->queue); - self->queue = NULL; - + g_clear_object (&self->queue); g_mutex_clear (&self->mutex); - G_OBJECT_CLASS (parent_class)->dispose (object); + G_OBJECT_CLASS (parent_class)->finalize (object); } static void