diff --git a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/MLOperatorAuthorImpl.h b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/MLOperatorAuthorImpl.h index 5613d0bdd6..dd1b743587 100644 --- a/onnxruntime/core/providers/dml/DmlExecutionProvider/src/MLOperatorAuthorImpl.h +++ b/onnxruntime/core/providers/dml/DmlExecutionProvider/src/MLOperatorAuthorImpl.h @@ -133,6 +133,8 @@ public: m_isClosed = true; } + virtual ~Closable() {} + protected: void VerifyNotClosed() const { diff --git a/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.h b/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.h index 023de90c39..829745251f 100644 --- a/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.h +++ b/onnxruntime/core/providers/dml/OperatorAuthorHelper/OperatorHelper.h @@ -299,12 +299,14 @@ struct IKernelInformationAdapter virtual MLOperatorTensor GetConstantInputTensor(uint32_t inputIndex) const = 0; virtual bool HasAttribute(_In_z_ MLConstStringParam name, MLOperatorAttributeType type) const noexcept = 0; virtual MLOperatorAttributes const& GetAttributes() const noexcept = 0; + virtual ~IKernelInformationAdapter() {} }; struct IShapeInformationAdapter { virtual uint32_t GetInputTensorDimensionCount(uint32_t inputIndex) const = 0; virtual std::vector GetInputTensorShape(uint32_t inputIndex) const = 0; + virtual ~IShapeInformationAdapter() {} }; // To avoid duplicating dozens of templated functions that vary only on the source of the kernel @@ -323,6 +325,7 @@ struct KernelInformationAdapter : IKernelInformationAdapter virtual MLOperatorTensor GetConstantInputTensor(uint32_t inputIndex) const { return m_informationSource.GetConstantInputTensor(inputIndex); } virtual bool HasAttribute(_In_z_ MLConstStringParam name, MLOperatorAttributeType type) const noexcept { return m_informationSource.HasAttribute(name, type); } virtual MLOperatorAttributes const& GetAttributes() const noexcept { return m_informationSource; } + virtual ~KernelInformationAdapter() {} InformationSourceType& m_informationSource; }; @@ -338,6 +341,7 @@ struct ShapeInformationAdapter : IShapeInformationAdapter virtual uint32_t GetInputTensorDimensionCount(uint32_t inputIndex) const { return m_informationSource.GetInputTensorDimensionCount(inputIndex); } virtual std::vector GetInputTensorShape(uint32_t inputIndex) const { return m_informationSource.GetInputTensorShape(inputIndex); } + virtual ~ShapeInformationAdapter() {} InformationSourceType& m_informationSource; }; diff --git a/winml/lib/Api/impl/TensorMemoryBufferReference.h b/winml/lib/Api/impl/TensorMemoryBufferReference.h index 6ef4b9ce12..0bfdec49d9 100644 --- a/winml/lib/Api/impl/TensorMemoryBufferReference.h +++ b/winml/lib/Api/impl/TensorMemoryBufferReference.h @@ -44,6 +44,8 @@ struct TensorResources { WINML_CATCH_ALL_COM } + virtual ~TensorResources() {} + // Theses are access directly by TensorMemoryBufferReference and TensorBase std::shared_ptr<_winml::Tensor> cpu_resource_; winrt::com_ptr gpu_resource_; diff --git a/winml/lib/Common/inc/WinMLTelemetryHelper.h b/winml/lib/Common/inc/WinMLTelemetryHelper.h index a34b2b41d7..6e95061b01 100644 --- a/winml/lib/Common/inc/WinMLTelemetryHelper.h +++ b/winml/lib/Common/inc/WinMLTelemetryHelper.h @@ -64,7 +64,8 @@ class WinMLTelemetryHelper { bool telemetry_enabled_ = false; WinMLTelemetryHelper(); - ~WinMLTelemetryHelper(); + virtual ~WinMLTelemetryHelper(); + // // Register telemetry provider and check success. Will only succeed if