Commit cbff147f authored by Guillaume Desmottes's avatar Guillaume Desmottes 🐐
Browse files

kmssink: fix tmp_kmsmem leaks

configure_mode_setting() keeps a ref on tmp_kmsmem which is released in
gst_kms_sink_show_frame().
But if for some reason configure_mode_setting() is re-called before
showing a frame or if none is showed this memory was leaked.
parent 6ca10c63
......@@ -461,6 +461,7 @@ configure_mode_setting (GstKMSSink * self, GstVideoInfo * vinfo)
if (err)
goto modesetting_failed;
g_clear_pointer (&self->tmp_kmsmem, gst_memory_unref);
self->tmp_kmsmem = (GstMemory *) kmsmem;
ret = TRUE;
......@@ -1838,6 +1839,7 @@ gst_kms_sink_finalize (GObject * object)
gst_poll_free (sink->poll);
g_clear_pointer (&sink->connector_props, gst_structure_free);
g_clear_pointer (&sink->plane_props, gst_structure_free);
g_clear_pointer (&sink->tmp_kmsmem, gst_memory_unref);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment