From 34d640e17d0c4e02e9dc9ec188e1a467af508064 Mon Sep 17 00:00:00 2001 From: Julia Dark Date: Thu, 19 Dec 2024 13:19:37 -0500 Subject: [PATCH] Make destructors of base classes virtual --- libtiledbsoma/src/geometry/base.h | 4 +++- libtiledbsoma/src/soma/soma_array.h | 2 +- libtiledbsoma/src/soma/soma_collection.h | 2 +- libtiledbsoma/src/soma/soma_group.h | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libtiledbsoma/src/geometry/base.h b/libtiledbsoma/src/geometry/base.h index 6a9aa27f08..9673e9fdf6 100644 --- a/libtiledbsoma/src/geometry/base.h +++ b/libtiledbsoma/src/geometry/base.h @@ -20,6 +20,8 @@ struct BasePoint { , m(m) { } + virtual ~BasePoint() = default; + double_t x; double_t y; std::optional z; @@ -27,4 +29,4 @@ struct BasePoint { }; } // namespace tiledbsoma::geometry -#endif // TILEDBSOMA_GEOMETRY_BASE_H \ No newline at end of file +#endif // TILEDBSOMA_GEOMETRY_BASE_H diff --git a/libtiledbsoma/src/soma/soma_array.h b/libtiledbsoma/src/soma/soma_array.h index a44d7a3e5b..8acb504594 100644 --- a/libtiledbsoma/src/soma/soma_array.h +++ b/libtiledbsoma/src/soma/soma_array.h @@ -249,7 +249,7 @@ class SOMAArray : public SOMAObject { } SOMAArray() = delete; - ~SOMAArray() = default; + virtual ~SOMAArray() = default; /** * @brief Get URI of the SOMAArray. diff --git a/libtiledbsoma/src/soma/soma_collection.h b/libtiledbsoma/src/soma/soma_collection.h index 60dc170fd2..2611592cdd 100644 --- a/libtiledbsoma/src/soma/soma_collection.h +++ b/libtiledbsoma/src/soma/soma_collection.h @@ -114,7 +114,7 @@ class SOMACollection : public SOMAGroup { SOMACollection() = delete; SOMACollection(const SOMACollection&) = default; SOMACollection(SOMACollection&&) = default; - ~SOMACollection() = default; + virtual ~SOMACollection() = default; using iterator = typename std::map>::iterator; diff --git a/libtiledbsoma/src/soma/soma_group.h b/libtiledbsoma/src/soma/soma_group.h index 070d469eb4..29e1266f4f 100644 --- a/libtiledbsoma/src/soma/soma_group.h +++ b/libtiledbsoma/src/soma/soma_group.h @@ -114,7 +114,7 @@ class SOMAGroup : public SOMAObject { SOMAGroup() = delete; SOMAGroup(const SOMAGroup&) = default; SOMAGroup(SOMAGroup&&) = default; - ~SOMAGroup() = default; + virtual ~SOMAGroup() = default; /** * Open the SOMAGroup object.