gl: Free various props during cleanup

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
This commit is contained in:
Doug Nazar 2025-03-14 22:09:21 -04:00 committed by GStreamer Marge Bot
parent a7dce91f0d
commit 3a20c0bca3
3 changed files with 40 additions and 2 deletions

View file

@ -65,6 +65,7 @@ G_DEFINE_TYPE_WITH_CODE (GstGLBumper, gst_gl_bumper, GST_TYPE_GL_FILTER,
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (glbumper, "glbumper",
GST_RANK_NONE, GST_TYPE_GL_BUMPER, gl_element_init (plugin));
static void gst_gl_bumper_finalize (GObject * object);
static void gst_gl_bumper_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_gl_bumper_get_property (GObject * object, guint prop_id,
@ -281,6 +282,7 @@ gst_gl_bumper_class_init (GstGLBumperClass * klass)
gobject_class = (GObjectClass *) klass;
element_class = GST_ELEMENT_CLASS (klass);
gobject_class->finalize = gst_gl_bumper_finalize;
gobject_class->set_property = gst_gl_bumper_set_property;
gobject_class->get_property = gst_gl_bumper_get_property;
@ -316,6 +318,16 @@ gst_gl_bumper_init (GstGLBumper * bumper)
bumper->location = NULL;
}
static void
gst_gl_bumper_finalize (GObject * object)
{
GstGLBumper *bumper = GST_GL_BUMPER (object);
g_free (bumper->location);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gst_gl_bumper_reset (GstGLFilter * filter)
{

View file

@ -62,6 +62,7 @@ G_DEFINE_TYPE_WITH_CODE (GstGLDifferenceMatte, gst_gl_differencematte,
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gldifferencematte, "gldifferencematte",
GST_RANK_NONE, GST_TYPE_GL_DIFFERENCEMATTE, gl_element_init (plugin));
static void gst_gl_differencematte_finalize (GObject * object);
static void gst_gl_differencematte_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_gl_differencematte_get_property (GObject * object,
@ -215,8 +216,10 @@ gst_gl_differencematte_gl_stop (GstGLBaseFilter * base_filter)
differencematte->midtexture[i] = NULL;
}
}
differencematte->location = NULL;
differencematte->pixbuf = NULL;
if (differencematte->pixbuf) {
free (differencematte->pixbuf);
differencematte->pixbuf = NULL;
}
differencematte->bg_has_changed = FALSE;
GST_GL_BASE_FILTER_CLASS (parent_class)->gl_stop (base_filter);
@ -233,6 +236,7 @@ gst_gl_differencematte_class_init (GstGLDifferenceMatteClass * klass)
gst_gl_filter_add_rgba_pad_templates (GST_GL_FILTER_CLASS (klass));
gobject_class->finalize = gst_gl_differencematte_finalize;
gobject_class->set_property = gst_gl_differencematte_set_property;
gobject_class->get_property = gst_gl_differencematte_get_property;
@ -274,6 +278,16 @@ gst_gl_differencematte_init (GstGLDifferenceMatte * differencematte)
fill_gaussian_kernel (differencematte->kernel, 7, 30.0);
}
static void
gst_gl_differencematte_finalize (GObject * object)
{
GstGLDifferenceMatte *differencematte = GST_GL_DIFFERENCEMATTE (object);
g_free (differencematte->location);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gst_gl_differencematte_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)

View file

@ -72,6 +72,7 @@ GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gloverlay, "gloverlay",
static gboolean gst_gl_overlay_set_caps (GstGLFilter * filter,
GstCaps * incaps, GstCaps * outcaps);
static void gst_gl_overlay_finalize (GObject * object);
static void gst_gl_overlay_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_gl_overlay_get_property (GObject * object, guint prop_id,
@ -203,6 +204,7 @@ gst_gl_overlay_class_init (GstGLOverlayClass * klass)
gst_gl_filter_add_rgba_pad_templates (GST_GL_FILTER_CLASS (klass));
gobject_class->finalize = gst_gl_overlay_finalize;
gobject_class->set_property = gst_gl_overlay_set_property;
gobject_class->get_property = gst_gl_overlay_get_property;
@ -288,6 +290,16 @@ gst_gl_overlay_init (GstGLOverlay * overlay)
overlay->alpha = 1.0;
}
static void
gst_gl_overlay_finalize (GObject * object)
{
GstGLOverlay *overlay = GST_GL_OVERLAY (object);
g_free (overlay->location);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gst_gl_overlay_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)