diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /dom/webgpu/BindGroup.cpp | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/webgpu/BindGroup.cpp')
-rw-r--r-- | dom/webgpu/BindGroup.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/dom/webgpu/BindGroup.cpp b/dom/webgpu/BindGroup.cpp index 7ae5b8c3bb..b3cd3d9d5e 100644 --- a/dom/webgpu/BindGroup.cpp +++ b/dom/webgpu/BindGroup.cpp @@ -22,13 +22,21 @@ BindGroup::BindGroup(Device* const aParent, RawId aId) BindGroup::~BindGroup() { Cleanup(); } void BindGroup::Cleanup() { - if (mValid && mParent) { - mValid = false; - auto bridge = mParent->GetBridge(); - if (bridge && bridge->IsOpen()) { - bridge->SendBindGroupDrop(mId); - } + if (!mValid) { + return; } + mValid = false; + + auto bridge = mParent->GetBridge(); + if (!bridge) { + return; + } + + if (bridge->CanSend()) { + bridge->SendBindGroupDrop(mId); + } + + wgpu_client_free_bind_group_id(bridge->GetClient(), mId); } } // namespace mozilla::webgpu |