[886/906] fixup a memory leak of the context in the GLTextureUploadMeta path
gst_structure_get returns a reference to the object and we asked for another with gst_object_replace. https://bugzilla.gnome.org/show_bug.cgi?id=724816
This commit is contained in:
parent
506e4fc793
commit
687ac78290
@ -867,9 +867,13 @@ gst_gl_filter_decide_allocation (GstBaseTransform * trans, GstQuery * query)
|
|||||||
|
|
||||||
gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params);
|
gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params);
|
||||||
if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext",
|
if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext",
|
||||||
GST_GL_TYPE_CONTEXT, &context, NULL) && context)
|
GST_GL_TYPE_CONTEXT, &context, NULL) && context) {
|
||||||
gst_object_replace ((GstObject **) & filter->context,
|
GstGLContext *old = filter->context;
|
||||||
(GstObject *) context);
|
|
||||||
|
filter->context = context;
|
||||||
|
if (old)
|
||||||
|
gst_object_unref (old);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filter->context) {
|
if (!filter->context) {
|
||||||
|
@ -624,8 +624,13 @@ gst_gl_test_src_decide_allocation (GstBaseSrc * basesrc, GstQuery * query)
|
|||||||
|
|
||||||
gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params);
|
gst_query_parse_nth_allocation_meta (query, idx, &upload_meta_params);
|
||||||
if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext",
|
if (gst_structure_get (upload_meta_params, "gst.gl.GstGLContext",
|
||||||
GST_GL_TYPE_CONTEXT, &context, NULL) && context)
|
GST_GL_TYPE_CONTEXT, &context, NULL) && context) {
|
||||||
gst_object_replace ((GstObject **) & src->context, (GstObject *) context);
|
GstGLContext *old = src->context;
|
||||||
|
|
||||||
|
src->context = context;
|
||||||
|
if (old)
|
||||||
|
gst_object_unref (old);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!src->context) {
|
if (!src->context) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user