summaryrefslogtreecommitdiffstats
path: root/sys/v4l2
diff options
context:
space:
mode:
Diffstat (limited to 'sys/v4l2')
-rw-r--r--sys/v4l2/gstv4l2object.c15
-rw-r--r--sys/v4l2/gstv4l2object.h2
-rw-r--r--sys/v4l2/gstv4l2src.c9
3 files changed, 16 insertions, 10 deletions
diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c
index 48497fc7..c842e8b9 100644
--- a/sys/v4l2/gstv4l2object.c
+++ b/sys/v4l2/gstv4l2object.c
@@ -278,17 +278,14 @@ gst_v4l2_object_new (GstElement * element,
}
void
-gst_v4l2_object_destroy (GstV4l2Object ** v4l2object)
+gst_v4l2_object_destroy (GstV4l2Object * v4l2object)
{
- if (*v4l2object) {
- if ((*v4l2object)->videodev) {
- g_free ((*v4l2object)->videodev);
- (*v4l2object)->videodev = NULL;
- }
+ g_return_if_fail (v4l2object != NULL);
- g_free (*v4l2object);
- *v4l2object = NULL;
- }
+ if (v4l2object->videodev)
+ g_free (v4l2object->videodev);
+
+ g_free (v4l2object);
}
gboolean
diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h
index 906cff99..f309bc7d 100644
--- a/sys/v4l2/gstv4l2object.h
+++ b/sys/v4l2/gstv4l2object.h
@@ -117,7 +117,7 @@ GstV4l2Object * gst_v4l2_object_new (GstElement * element,
GstV4l2GetInOutFunction get_in_out_func,
GstV4l2SetInOutFunction set_in_out_func,
GstV4l2UpdateFpsFunction update_fps_func);
-void gst_v4l2_object_destroy (GstV4l2Object ** v4l2object);
+void gst_v4l2_object_destroy (GstV4l2Object * v4l2object);
/* properties */
void gst_v4l2_object_install_properties_helper (GObjectClass *gobject_class);
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c
index 4aeb6f1e..cddad936 100644
--- a/sys/v4l2/gstv4l2src.c
+++ b/sys/v4l2/gstv4l2src.c
@@ -223,6 +223,7 @@ GST_BOILERPLATE_FULL (GstV4l2Src, gst_v4l2src, GstPushSrc, GST_TYPE_PUSH_SRC,
gst_v4l2src_init_interfaces);
static void gst_v4l2src_dispose (GObject * object);
+static void gst_v4l2src_finalize (GstV4l2Src * v4l2src);
/* basesrc methods */
static gboolean gst_v4l2src_start (GstBaseSrc * src);
@@ -270,6 +271,7 @@ gst_v4l2src_class_init (GstV4l2SrcClass * klass)
pushsrc_class = GST_PUSH_SRC_CLASS (klass);
gobject_class->dispose = gst_v4l2src_dispose;
+ gobject_class->finalize = (GObjectFinalizeFunc) gst_v4l2src_finalize;
gobject_class->set_property = gst_v4l2src_set_property;
gobject_class->get_property = gst_v4l2src_get_property;
@@ -325,6 +327,13 @@ gst_v4l2src_dispose (GObject * object)
G_OBJECT_CLASS (parent_class)->dispose (object);
}
+static void
+gst_v4l2src_finalize (GstV4l2Src * v4l2src)
+{
+ gst_v4l2_object_destroy (v4l2src->v4l2object);
+
+ G_OBJECT_CLASS (parent_class)->finalize ((GObject *) (v4l2src));
+}
static void
gst_v4l2src_set_property (GObject * object,