diff --git a/BAN/include/BAN/RefPtr.h b/BAN/include/BAN/RefPtr.h index ca881f3ce7..e76a542618 100644 --- a/BAN/include/BAN/RefPtr.h +++ b/BAN/include/BAN/RefPtr.h @@ -36,7 +36,7 @@ namespace BAN protected: RefCounted() = default; - ~RefCounted() { ASSERT(m_ref_count == 0); } + virtual ~RefCounted() { ASSERT(m_ref_count == 0); } private: mutable uint32_t m_ref_count = 1; diff --git a/BAN/include/BAN/WeakPtr.h b/BAN/include/BAN/WeakPtr.h index 7cb7063e20..4c999731dc 100644 --- a/BAN/include/BAN/WeakPtr.h +++ b/BAN/include/BAN/WeakPtr.h @@ -34,7 +34,7 @@ namespace BAN class Weakable { public: - ~Weakable() + virtual ~Weakable() { if (m_link) m_link->invalidate(); @@ -82,7 +82,7 @@ namespace BAN RefPtr lock() { - if (m_link->valid()) + if (valid()) return m_link->lock(); return nullptr; }