Skip to content

Commit

Permalink
Cherry-pick 1004779. rdar://123745437
Browse files Browse the repository at this point in the history
    [WebGPU] WebGPU::setUncapturedScopeCallback may crash if repeatedly invoked
    https://bugs.webkit.org/show_bug.cgi?id=270244
    <radar://123745437>

    Reviewed by Dan Glastonbury.

    We can only call this once, so null-out the callback
    after it has been called.

    * Source/WebGPU/WebGPU/Device.mm:
    (WebGPU::Device::generateAValidationError):

    Canonical link: https://commits.webkit.org/275478@main

Canonical link: https://commits.webkit.org/274941.58@safari-7619.1.5-branch
  • Loading branch information
mwyrzykowski authored and Dan Robson committed Mar 3, 2024
1 parent aad6fc6 commit a78c4a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/WebGPU/WebGPU/Device.mm
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,10 @@ static void captureFrame(id<MTLDevice> captureObject)
return;
}

if (m_uncapturedErrorCallback)
if (m_uncapturedErrorCallback) {
m_uncapturedErrorCallback(WGPUErrorType_Validation, WTFMove(message));
m_uncapturedErrorCallback = nullptr;
}
}

void Device::generateAnOutOfMemoryError(String&& message)
Expand Down

0 comments on commit a78c4a3

Please sign in to comment.