summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2019-03-07 19:26:56 +0000
committerTim-Philipp Müller <tim@centricular.com>2019-03-08 01:18:39 +0000
commitecb7049d7ead022c5f855f69639fdb8f494c4842 (patch)
treee36954c7dea419b5b075e3e3093017b6966e6a81
parentc930c42aa893aedd914852eda1457226b8e52063 (diff)
vulkan: fix some leaks
Fix vk_instance leak when state change fails like in generic/states unit test.
-rw-r--r--ext/vulkan/vkupload.c2
-rw-r--r--ext/vulkan/vkutils.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/ext/vulkan/vkupload.c b/ext/vulkan/vkupload.c
index ffe963ef9..6a139af64 100644
--- a/ext/vulkan/vkupload.c
+++ b/ext/vulkan/vkupload.c
@@ -522,6 +522,8 @@ gst_vulkan_upload_finalize (GObject * object)
for (i = 0; i < G_N_ELEMENTS (upload_methods); 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);
}
diff --git a/ext/vulkan/vkutils.c b/ext/vulkan/vkutils.c
index 1c25cb812..aaa6bba23 100644
--- a/ext/vulkan/vkutils.c
+++ b/ext/vulkan/vkutils.c
@@ -247,6 +247,8 @@ gst_vulkan_ensure_element_data (gpointer 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_object_unref (*instance_ptr);
+ *instance_ptr = NULL;
g_clear_error (&error);
return FALSE;
}