mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 10:12:20 +00:00
vulkan: fix some leaks
Fix vk_instance leak when state change fails like in generic/states unit test.
This commit is contained in:
parent
c930c42aa8
commit
ecb7049d7e
2 changed files with 4 additions and 0 deletions
|
@ -522,6 +522,8 @@ gst_vulkan_upload_finalize (GObject * object)
|
||||||
for (i = 0; i < G_N_ELEMENTS (upload_methods); i++) {
|
for (i = 0; i < G_N_ELEMENTS (upload_methods); i++) {
|
||||||
upload_methods[i]->free (vk_upload->upload_impls[i]);
|
upload_methods[i]->free (vk_upload->upload_impls[i]);
|
||||||
}
|
}
|
||||||
|
g_free (vk_upload->upload_impls);
|
||||||
|
vk_upload->upload_impls = NULL;
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
|
@ -247,6 +247,8 @@ gst_vulkan_ensure_element_data (gpointer 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_object_unref (*instance_ptr);
|
||||||
|
*instance_ptr = NULL;
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue