Bug 1940671 - Fix command buffer id leak. r=webgpu-reviewers,ErichDonGubler

Differential Revision: https://phabricator.services.mozilla.com/D234023
This commit is contained in:
Nicolas Silva
2025-01-14 08:08:00 +00:00
parent 12b6be8aa3
commit 376f6268f9
2 changed files with 5 additions and 0 deletions

View File

@@ -1319,6 +1319,7 @@ ipc::IPCResult WebGPUParent::RecvSwapChainPresent(
ffi::wgpu_server_encoder_finish(mContext.get(), aCommandEncoderId,
&commandDesc, error.ToFFI());
if (ForwardError(data->mDeviceId, error)) {
ffi::wgpu_server_encoder_drop(mContext.get(), aCommandEncoderId);
return IPC_OK();
}
}
@@ -1327,6 +1328,7 @@ ipc::IPCResult WebGPUParent::RecvSwapChainPresent(
ErrorBuffer error;
ffi::wgpu_server_queue_submit(mContext.get(), data->mQueueId,
&aCommandEncoderId, 1, error.ToFFI());
ffi::wgpu_server_encoder_drop(mContext.get(), aCommandEncoderId);
if (ForwardError(data->mDeviceId, error)) {
return IPC_OK();
}