gl: Fix GError leaks during failures

https://bugzilla.gnome.org/show_bug.cgi?id=755140
This commit is contained in:
Vineeth T M 2015-09-17 13:35:02 +09:00 committed by Tim-Philipp Müller
parent b537e98ae7
commit 6944433677
6 changed files with 6 additions and 2 deletions

View file

@ -496,6 +496,7 @@ context_error:
{
GST_ELEMENT_ERROR (mix, RESOURCE, NOT_FOUND, ("%s", error->message),
(NULL));
g_clear_error (&error);
return FALSE;
}
}

View file

@ -587,6 +587,7 @@ context_error:
{
GST_ELEMENT_ERROR (self, RESOURCE, NOT_FOUND, ("%s", error->message),
(NULL));
g_clear_error (&error);
return FALSE;
}
}

View file

@ -853,6 +853,7 @@ context_error:
{
GST_ELEMENT_ERROR (src, RESOURCE, NOT_FOUND, ("%s", error->message),
(NULL));
g_clear_error (&error);
if (src->context)
gst_object_unref (src->context);
src->context = NULL;

View file

@ -110,6 +110,7 @@ _mem_create_gl (GstGLContext * context, struct create_data *transfer)
GST_CAT_ERROR (GST_CAT_GL_BASE_BUFFER, "Failed to create GL buffer: %s",
error->message);
g_clear_error (&error);
}
void

View file

@ -368,6 +368,7 @@ context_error:
{
GST_ELEMENT_ERROR (trans, RESOURCE, NOT_FOUND, ("%s", error->message),
(NULL));
g_clear_error (&error);
return FALSE;
}
error:

View file

@ -178,7 +178,6 @@ gst_gl_filter_gl_start (GstGLBaseFilter * base_filter)
GstGLFilterClass *filter_class = GST_GL_FILTER_GET_CLASS (filter);
GstGLContext *context = GST_GL_BASE_FILTER (filter)->context;
gint out_width, out_height;
GError *error = NULL;
out_width = GST_VIDEO_INFO_WIDTH (&filter->out_info);
out_height = GST_VIDEO_INFO_HEIGHT (&filter->out_info);
@ -205,7 +204,7 @@ gst_gl_filter_gl_start (GstGLBaseFilter * base_filter)
context_error:
{
GST_ELEMENT_ERROR (filter, RESOURCE, NOT_FOUND, ("%s", error->message),
GST_ELEMENT_ERROR (filter, RESOURCE, NOT_FOUND, ("Could not generate FBO"),
(NULL));
return FALSE;
}