Fix memory leak in wgpu lib

This commit is contained in:
Nikita Lisitsa 2024-06-03 18:15:33 +03:00
parent 22a57f91db
commit ad36acf238

View file

@ -8,11 +8,7 @@ namespace psemek::wgpu
queue device::get_queue() queue device::get_queue()
{ {
auto ptr = wgpuDeviceGetQueue((WGPUDevice)get()); return queue(wgpuDeviceGetQueue((WGPUDevice)get()));
// Queue is actually owned by the device
// Reference it to prevent destroying
wgpuQueueReference(ptr);
return queue(ptr);
} }
bind_group device::create_bind_group(bind_group::descriptor const & desc) bind_group device::create_bind_group(bind_group::descriptor const & desc)