Fix leak of ErrorData after Device::ConsumedError
The code to delete this ErrorData* was lost in the error scope refactor. Bug: chromium:1002783, chromium:1002888, dawn:153 Change-Id: Iebe13c778079501193b942ebd97a559041516c3d Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/11320 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
7dda7d0f2e
commit
b11bd2dfe5
|
@ -98,8 +98,10 @@ namespace dawn_native {
|
|||
mCurrentErrorScope->HandleError(type, message);
|
||||
}
|
||||
|
||||
void DeviceBase::HandleError(ErrorData* data) {
|
||||
mCurrentErrorScope->HandleError(data);
|
||||
void DeviceBase::ConsumeError(ErrorData* error) {
|
||||
ASSERT(error != nullptr);
|
||||
HandleError(error->GetType(), error->GetMessage().c_str());
|
||||
delete error;
|
||||
}
|
||||
|
||||
void DeviceBase::SetUncapturedErrorCallback(dawn::ErrorCallback callback, void* userdata) {
|
||||
|
|
|
@ -47,11 +47,10 @@ namespace dawn_native {
|
|||
virtual ~DeviceBase();
|
||||
|
||||
void HandleError(dawn::ErrorType type, const char* message);
|
||||
void HandleError(ErrorData* error);
|
||||
|
||||
bool ConsumedError(MaybeError maybeError) {
|
||||
if (DAWN_UNLIKELY(maybeError.IsError())) {
|
||||
HandleError(maybeError.AcquireError());
|
||||
ConsumeError(maybeError.AcquireError());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -237,6 +236,8 @@ namespace dawn_native {
|
|||
|
||||
void SetDefaultToggles();
|
||||
|
||||
void ConsumeError(ErrorData* error);
|
||||
|
||||
AdapterBase* mAdapter = nullptr;
|
||||
|
||||
Ref<ErrorScope> mRootErrorScope;
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "dawn_native/ErrorScope.h"
|
||||
|
||||
#include "common/Assert.h"
|
||||
#include "dawn_native/ErrorData.h"
|
||||
|
||||
namespace dawn_native {
|
||||
|
||||
|
@ -50,11 +49,6 @@ namespace dawn_native {
|
|||
HandleErrorImpl(this, type, message);
|
||||
}
|
||||
|
||||
void ErrorScope::HandleError(ErrorData* error) {
|
||||
ASSERT(error != nullptr);
|
||||
HandleErrorImpl(this, error->GetType(), error->GetMessage().c_str());
|
||||
}
|
||||
|
||||
// static
|
||||
void ErrorScope::HandleErrorImpl(ErrorScope* scope, dawn::ErrorType type, const char* message) {
|
||||
ErrorScope* currentScope = scope;
|
||||
|
|
|
@ -23,8 +23,6 @@
|
|||
|
||||
namespace dawn_native {
|
||||
|
||||
class ErrorData;
|
||||
|
||||
// Errors can be recorded into an ErrorScope by calling |HandleError|.
|
||||
// Because an error scope should not resolve until contained
|
||||
// commands are complete, calling the callback is deferred until it is destructed.
|
||||
|
@ -47,7 +45,6 @@ namespace dawn_native {
|
|||
ErrorScope* GetParent();
|
||||
|
||||
void HandleError(dawn::ErrorType type, const char* message);
|
||||
void HandleError(ErrorData* error);
|
||||
|
||||
void Destroy();
|
||||
|
||||
|
|
Loading…
Reference in New Issue