fixing leaks
Build / build (push) Successful in 1m15s
Test / build_and_test (push) Has been cancelled

This commit is contained in:
2026-05-06 12:55:41 +02:00
parent 4f0ada9034
commit 29cdf44233
6 changed files with 30 additions and 14 deletions
+5 -2
View File
@@ -58,13 +58,16 @@ pub fn submit(interface: *Interface, infos: []Interface.SubmitInfo, p_fence: ?*b
const allocator = soft_device.device_allocator.allocator();
const io = soft_device.interface.io();
const runners_counter = allocator.create(RefCounter) catch return VkError.OutOfDeviceMemory;
errdefer allocator.destroy(runners_counter);
runners_counter.* = .init;
runners_counter.setRef(infos.len);
for (infos) |info| {
// Cloning info to keep them alive until command execution ends
const cloned_info: Interface.SubmitInfo = .{
.command_buffers = info.command_buffers.clone(allocator) catch return VkError.OutOfDeviceMemory,
};
const runners_counter = allocator.create(RefCounter) catch return VkError.OutOfDeviceMemory;
runners_counter.* = .init;
self.group.async(io, Self.taskRunner, .{ self, cloned_info, p_fence, runners_counter });
}
}