Skip to content

Commit

Permalink
Fix delete-abstract-non-virtual-dtor warning emitted from clang
Browse files Browse the repository at this point in the history
This fixes memory leaks in usdDraco due to deleting derived
class via a base class pointer.

This is part of PR #1684 from @charlesfleche

(Internal change: 2263942)
  • Loading branch information
sunyab authored and pixar-oss committed Feb 28, 2023
1 parent 7e6952f commit 558918b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pxr/usd/plugin/usdDraco/exportAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ PXR_NAMESPACE_OPEN_SCOPE
///
class UsdDracoExportAttributeInterface {
public:
virtual ~UsdDracoExportAttributeInterface() = default;

virtual const UsdDracoAttributeDescriptor &GetDescriptor() const = 0;
virtual void GetFromMesh(const UsdGeomMesh &usdMesh,
size_t numPositions) = 0;
Expand Down
2 changes: 2 additions & 0 deletions pxr/usd/plugin/usdDraco/importAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ PXR_NAMESPACE_OPEN_SCOPE
///
class UsdDracoImportAttributeInterface {
public:
virtual ~UsdDracoImportAttributeInterface() = default;

virtual const UsdDracoAttributeDescriptor &GetDescriptor() const = 0;
virtual void SetToMesh(UsdGeomMesh *usdMesh) const = 0;
virtual void PopulateValues() = 0;
Expand Down

0 comments on commit 558918b

Please sign in to comment.