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:
Stéphane Cerveau 2024-05-31 12:28:40 +02:00 committed by GStreamer Marge Bot
parent c3f3fd7351
commit 7bbf5fd801

View file

@ -271,6 +271,7 @@ gst_vulkan_ensure_element_data (GstElement * element,
if (!gst_vulkan_instance_open (*instance_ptr, &error)) {
GST_ELEMENT_ERROR (element, RESOURCE, NOT_FOUND,
("Failed to create vulkan instance"), ("%s", error->message));
gst_clear_context (&context);
gst_object_unref (*instance_ptr);
*instance_ptr = NULL;
g_clear_error (&error);