[webkit-changes] [WebKit/WebKit] 0a69bc: [WebXR] Catch undeleted GL objects with OwnedGLObject
Dan Glastonbury
noreply at github.com
Sun Oct 23 16:56:32 PDT 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0a69bc3f00f0de42638cd745f3ccd1254c5014cc
https://github.com/WebKit/WebKit/commit/0a69bc3f00f0de42638cd745f3ccd1254c5014cc
Author: Dan Glastonbury <djg at apple.com>
Date: 2022-10-23 (Sun, 23 Oct 2022)
Changed paths:
M Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp
M Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h
M Source/WebCore/platform/graphics/GraphicsTypesGL.h
Log Message:
-----------
[WebXR] Catch undeleted GL objects with OwnedGLObject
https://bugs.webkit.org/show_bug.cgi?id=246841
rdar://101410305
Reviewed by Dean Jackson.
Use OwnedGLObject to ensure that OpenGL objects are correctly released
to avoid leaks. OwnedGLObject provides a reset/release interface similar
to std::unique_ptr. The results of reset() and release() are marked
[[nodiscard]] to signal the old value must be correctly handled. In
addition, release() must be called to disarm OwnedGLObject destructor
ASSERT.
* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.cpp:
(WebCore::WebXROpaqueFramebuffer::~WebXROpaqueFramebuffer):
(WebCore::WebXROpaqueFramebuffer::startFrame):
(WebCore::WebXROpaqueFramebuffer::setupFramebuffer):
* Source/WebCore/Modules/webxr/WebXROpaqueFramebuffer.h:
* Source/WebCore/platform/graphics/GraphicsContextGL.h:
(WebCore::OwnedGLObject::OwnedGLObject):
(WebCore::OwnedGLObject::~OwnedGLObject):
(WebCore::OwnedGLObject::operator=):
(WebCore::OwnedGLObject::operator bool const):
(WebCore::OwnedGLObject::operator PlatformGLObject const):
(WebCore::OwnedGLObject::deleteObject):
(WebCore::OwnedGLObject::makeObject):
Canonical link: https://commits.webkit.org/255900@main
More information about the webkit-changes
mailing list