mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-14 07:36:15 +00:00
Buffer DestroyImpl check for buffer resource to avoid double free
Double free was happening if buffer.Destroy() was called right before the buffer went out of scope since DestroyImpl wouldn't check to see if the resource was already released. Also refactor Destroy in Texture classes to match the pattern of Buffer classes. Added validation of the texture object when Destroy is called. Bug: dawn:124, chromium:947323 Change-Id: I0e4a652ff5b86a151b4919c781c1dd385b4e3213 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6060 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Natasha Lee <natlee@microsoft.com>
This commit is contained in:
committed by
Commit Bot service account
parent
14487c34f7
commit
20b0c33913
@@ -28,7 +28,7 @@ namespace dawn_native { namespace opengl {
|
||||
}
|
||||
|
||||
Buffer::~Buffer() {
|
||||
DestroyImpl();
|
||||
DestroyInternal();
|
||||
}
|
||||
|
||||
GLuint Buffer::GetHandle() const {
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace dawn_native { namespace opengl {
|
||||
}
|
||||
|
||||
Texture::~Texture() {
|
||||
Destroy();
|
||||
DestroyInternal();
|
||||
}
|
||||
|
||||
void Texture::DestroyImpl() {
|
||||
|
||||
Reference in New Issue
Block a user