mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-07-04 13:45:52 +00:00
vkutils: do not forget to clear context in case of error
The context is leaking in case of a failing instance open. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6975>
This commit is contained in:
parent
c3f3fd7351
commit
7bbf5fd801
|
@ -271,6 +271,7 @@ gst_vulkan_ensure_element_data (GstElement * element,
|
||||||
if (!gst_vulkan_instance_open (*instance_ptr, &error)) {
|
if (!gst_vulkan_instance_open (*instance_ptr, &error)) {
|
||||||
GST_ELEMENT_ERROR (element, RESOURCE, NOT_FOUND,
|
GST_ELEMENT_ERROR (element, RESOURCE, NOT_FOUND,
|
||||||
("Failed to create vulkan instance"), ("%s", error->message));
|
("Failed to create vulkan instance"), ("%s", error->message));
|
||||||
|
gst_clear_context (&context);
|
||||||
gst_object_unref (*instance_ptr);
|
gst_object_unref (*instance_ptr);
|
||||||
*instance_ptr = NULL;
|
*instance_ptr = NULL;
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
|
|
Loading…
Reference in a new issue