Преглед изворни кода

Merge pull request #37635 from qarmin/leak_vertex

Fixed leak with vertex_formats
Rémi Verschelde пре 5 година
родитељ
комит
befbdda7f2
1 измењених фајлова са 7 додато и 0 уклоњено
  1. 7 0
      drivers/vulkan/rendering_device_vulkan.cpp

+ 7 - 0
drivers/vulkan/rendering_device_vulkan.cpp

@@ -7050,6 +7050,13 @@ void RenderingDeviceVulkan::finalize() {
 		vmaDestroyBuffer(allocator, staging_buffer_blocks[i].buffer, staging_buffer_blocks[i].allocation);
 		vmaDestroyBuffer(allocator, staging_buffer_blocks[i].buffer, staging_buffer_blocks[i].allocation);
 	}
 	}
 
 
+	while (vertex_formats.size()) {
+		Map<VertexFormatID, VertexDescriptionCache>::Element *temp = vertex_formats.front();
+		memdelete_arr(temp->get().bindings);
+		memdelete_arr(temp->get().attributes);
+		vertex_formats.erase(temp);
+	}
+
 	//all these should be clear at this point
 	//all these should be clear at this point
 	ERR_FAIL_COND(descriptor_pools.size());
 	ERR_FAIL_COND(descriptor_pools.size());
 	ERR_FAIL_COND(dependency_map.size());
 	ERR_FAIL_COND(dependency_map.size());