vksink: Fix GError memory leak

https://bugzilla.gnome.org/show_bug.cgi?id=762842
This commit is contained in:
Vineeth TM 2016-02-29 10:33:45 +09:00 committed by Sebastian Dröge
parent 14521dc774
commit e821582c13

View file

@ -256,6 +256,7 @@ gst_vulkan_sink_change_state (GstElement * element, GstStateChange transition)
gst_vulkan_instance_create_device (vk_sink->instance, &error))) { gst_vulkan_instance_create_device (vk_sink->instance, &error))) {
GST_ELEMENT_ERROR (vk_sink, RESOURCE, NOT_FOUND, GST_ELEMENT_ERROR (vk_sink, RESOURCE, NOT_FOUND,
("Failed to create vulkan device"), ("%s", error->message)); ("Failed to create vulkan device"), ("%s", error->message));
g_clear_error (&error);
return GST_STATE_CHANGE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }
@ -269,6 +270,7 @@ gst_vulkan_sink_change_state (GstElement * element, GstStateChange transition)
if (!gst_vulkan_window_open (vk_sink->window, &error)) { if (!gst_vulkan_window_open (vk_sink->window, &error)) {
GST_ELEMENT_ERROR (vk_sink, RESOURCE, NOT_FOUND, GST_ELEMENT_ERROR (vk_sink, RESOURCE, NOT_FOUND,
("Failed to open window"), ("%s", error->message)); ("Failed to open window"), ("%s", error->message));
g_clear_error (&error);
return GST_STATE_CHANGE_FAILURE; return GST_STATE_CHANGE_FAILURE;
} }