qroverlay: Free various props before set & during cleanup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
This commit is contained in:
parent
e7d8bf8563
commit
765a6a963f
@ -102,6 +102,7 @@ GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (debugqroverlay, "debugqroverlay",
|
||||
GST_RANK_NONE, GST_TYPE_DEBUG_QR_OVERLAY, qroverlay_element_init (plugin));
|
||||
|
||||
|
||||
static void gst_debug_qr_overlay_finalize (GObject * object);
|
||||
static void gst_debug_qr_overlay_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec);
|
||||
static void gst_debug_qr_overlay_get_property (GObject * object, guint prop_id,
|
||||
@ -120,6 +121,7 @@ gst_debug_qr_overlay_class_init (GstDebugQROverlayClass * klass)
|
||||
GST_DEBUG_CATEGORY_INIT (gst_debug_qr_overlay_debug, "debugqroverlay", 0,
|
||||
"Qrcode overlay element");
|
||||
|
||||
gobject_class->finalize = gst_debug_qr_overlay_finalize;
|
||||
gobject_class->set_property = gst_debug_qr_overlay_set_property;
|
||||
gobject_class->get_property = gst_debug_qr_overlay_get_property;
|
||||
|
||||
@ -177,6 +179,18 @@ gst_debug_qr_overlay_init (GstDebugQROverlay * filter)
|
||||
filter->span_frame = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_debug_qr_overlay_finalize (GObject * object)
|
||||
{
|
||||
GstDebugQROverlay *filter = GST_DEBUG_QR_OVERLAY (object);
|
||||
|
||||
g_free (filter->extra_data_name);
|
||||
g_free (filter->extra_data_str);
|
||||
g_strfreev (filter->extra_data_array);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_debug_qr_overlay_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec)
|
||||
@ -191,6 +205,7 @@ gst_debug_qr_overlay_set_property (GObject * object, guint prop_id,
|
||||
filter->extra_data_span_buffers = g_value_get_int64 (value);
|
||||
break;
|
||||
case PROP_EXTRA_DATA_NAME:
|
||||
g_clear_pointer (&filter->extra_data_name, g_free);
|
||||
filter->extra_data_name = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_EXTRA_DATA_ARRAY:
|
||||
|
@ -120,6 +120,16 @@ get_qrcode_content (GstBaseQROverlay * base, GstBuffer * buf,
|
||||
return content;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_qr_overlay_finalize (GObject * object)
|
||||
{
|
||||
GstQROverlay *self = GST_QR_OVERLAY (object);
|
||||
|
||||
g_free (self->data);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_qr_overlay_set_property (GObject * object, guint prop_id,
|
||||
const GValue * value, GParamSpec * pspec)
|
||||
@ -129,6 +139,7 @@ gst_qr_overlay_set_property (GObject * object, guint prop_id,
|
||||
switch (prop_id) {
|
||||
case PROP_DATA:
|
||||
GST_OBJECT_LOCK (self);
|
||||
g_free (self->data);
|
||||
self->data = g_value_dup_string (value);
|
||||
self->data_changed = TRUE;
|
||||
GST_OBJECT_UNLOCK (self);
|
||||
@ -164,7 +175,7 @@ gst_qr_overlay_class_init (GstQROverlayClass * klass)
|
||||
gobject_class = (GObjectClass *) klass;
|
||||
gstelement_class = (GstElementClass *) klass;
|
||||
|
||||
|
||||
gobject_class->finalize = gst_qr_overlay_finalize;
|
||||
gobject_class->set_property = gst_qr_overlay_set_property;
|
||||
gobject_class->get_property = gst_qr_overlay_get_property;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user