From 3b808be7c5fbdb628d7bc7757aa46797fc22c3c4 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 14 Jun 2022 16:34:46 +0000 Subject: [PATCH] dawn::wire::client: Make ObjectBase destructor virtual. Also adds override to all child classes' destructor so they correctly get put in the vtable. Bug: dawn:1451 Change-Id: Ic03841392b994f9bdc8487b6abc88bd86128e783 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/93443 Commit-Queue: Corentin Wallez Reviewed-by: Austin Eng Reviewed-by: Loko Kung Kokoro: Kokoro --- src/dawn/wire/client/Adapter.h | 2 +- src/dawn/wire/client/Buffer.h | 2 +- src/dawn/wire/client/Device.h | 2 +- src/dawn/wire/client/Instance.h | 2 +- src/dawn/wire/client/ObjectBase.h | 2 +- src/dawn/wire/client/QuerySet.h | 2 +- src/dawn/wire/client/Queue.h | 2 +- src/dawn/wire/client/ShaderModule.h | 2 +- src/dawn/wire/client/Texture.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/dawn/wire/client/Adapter.h b/src/dawn/wire/client/Adapter.h index de9d167aa6..9c4b36fe38 100644 --- a/src/dawn/wire/client/Adapter.h +++ b/src/dawn/wire/client/Adapter.h @@ -28,7 +28,7 @@ namespace dawn::wire::client { class Adapter final : public ObjectBase { public: using ObjectBase::ObjectBase; - ~Adapter(); + ~Adapter() override; void CancelCallbacksForDisconnect() override; diff --git a/src/dawn/wire/client/Buffer.h b/src/dawn/wire/client/Buffer.h index caeaa6f815..8484164586 100644 --- a/src/dawn/wire/client/Buffer.h +++ b/src/dawn/wire/client/Buffer.h @@ -32,7 +32,7 @@ class Buffer final : public ObjectBase { static WGPUBuffer CreateError(Device* device, const WGPUBufferDescriptor* descriptor); using ObjectBase::ObjectBase; - ~Buffer(); + ~Buffer() override; bool OnMapAsyncCallback(uint64_t requestSerial, uint32_t status, diff --git a/src/dawn/wire/client/Device.h b/src/dawn/wire/client/Device.h index 14599ba851..185cbd04a3 100644 --- a/src/dawn/wire/client/Device.h +++ b/src/dawn/wire/client/Device.h @@ -33,7 +33,7 @@ class Queue; class Device final : public ObjectBase { public: explicit Device(const ObjectBaseParams& params); - ~Device(); + ~Device() override; void SetUncapturedErrorCallback(WGPUErrorCallback errorCallback, void* errorUserdata); void SetLoggingCallback(WGPULoggingCallback errorCallback, void* errorUserdata); diff --git a/src/dawn/wire/client/Instance.h b/src/dawn/wire/client/Instance.h index 5b876a252b..1400565890 100644 --- a/src/dawn/wire/client/Instance.h +++ b/src/dawn/wire/client/Instance.h @@ -27,7 +27,7 @@ namespace dawn::wire::client { class Instance final : public ObjectBase { public: using ObjectBase::ObjectBase; - ~Instance(); + ~Instance() override; void CancelCallbacksForDisconnect() override; diff --git a/src/dawn/wire/client/ObjectBase.h b/src/dawn/wire/client/ObjectBase.h index cd6042da25..cf5f8ee7a2 100644 --- a/src/dawn/wire/client/ObjectBase.h +++ b/src/dawn/wire/client/ObjectBase.h @@ -37,7 +37,7 @@ struct ObjectBaseParams { class ObjectBase : public LinkNode { public: explicit ObjectBase(const ObjectBaseParams& params); - ~ObjectBase(); + virtual ~ObjectBase(); virtual void CancelCallbacksForDisconnect() {} diff --git a/src/dawn/wire/client/QuerySet.h b/src/dawn/wire/client/QuerySet.h index ee152e5260..fc5a73e8ee 100644 --- a/src/dawn/wire/client/QuerySet.h +++ b/src/dawn/wire/client/QuerySet.h @@ -28,7 +28,7 @@ class QuerySet final : public ObjectBase { static WGPUQuerySet Create(Device* device, const WGPUQuerySetDescriptor* descriptor); using ObjectBase::ObjectBase; - ~QuerySet(); + ~QuerySet() override; // Note that these values can be arbitrary since they aren't validated in the wire client. WGPUQueryType GetType() const; diff --git a/src/dawn/wire/client/Queue.h b/src/dawn/wire/client/Queue.h index 6b59d96b4e..28424c0b45 100644 --- a/src/dawn/wire/client/Queue.h +++ b/src/dawn/wire/client/Queue.h @@ -26,7 +26,7 @@ namespace dawn::wire::client { class Queue final : public ObjectBase { public: using ObjectBase::ObjectBase; - ~Queue(); + ~Queue() override; bool OnWorkDoneCallback(uint64_t requestSerial, WGPUQueueWorkDoneStatus status); diff --git a/src/dawn/wire/client/ShaderModule.h b/src/dawn/wire/client/ShaderModule.h index d8869ba8e6..c6d4153b63 100644 --- a/src/dawn/wire/client/ShaderModule.h +++ b/src/dawn/wire/client/ShaderModule.h @@ -25,7 +25,7 @@ namespace dawn::wire::client { class ShaderModule final : public ObjectBase { public: using ObjectBase::ObjectBase; - ~ShaderModule(); + ~ShaderModule() override; void GetCompilationInfo(WGPUCompilationInfoCallback callback, void* userdata); bool GetCompilationInfoCallback(uint64_t requestSerial, diff --git a/src/dawn/wire/client/Texture.h b/src/dawn/wire/client/Texture.h index db7d7059d4..10bc5fa36d 100644 --- a/src/dawn/wire/client/Texture.h +++ b/src/dawn/wire/client/Texture.h @@ -28,7 +28,7 @@ class Texture final : public ObjectBase { static WGPUTexture Create(Device* device, const WGPUTextureDescriptor* descriptor); using ObjectBase::ObjectBase; - ~Texture(); + ~Texture() override; // Note that these values can be arbitrary since they aren't validated in the wire client. uint32_t GetWidth() const;