diff --git a/src/core/dev_api/openvino/core/so_extension.hpp b/src/core/dev_api/openvino/core/so_extension.hpp index 931344b5fc4958..9181c6b45691f3 100644 --- a/src/core/dev_api/openvino/core/so_extension.hpp +++ b/src/core/dev_api/openvino/core/so_extension.hpp @@ -13,9 +13,7 @@ namespace detail { class OPENVINO_API SOExtension : public Extension { public: - ~SOExtension() { - m_ext = {}; - } + virtual ~SOExtension() override; SOExtension(const Extension::Ptr& ext, const std::shared_ptr& so) : m_ext(ext), m_so(so) {} diff --git a/src/core/include/openvino/core/op_extension.hpp b/src/core/include/openvino/core/op_extension.hpp index d8fbb791edbe8d..bf97497f166a37 100644 --- a/src/core/include/openvino/core/op_extension.hpp +++ b/src/core/include/openvino/core/op_extension.hpp @@ -46,7 +46,7 @@ class OPENVINO_API BaseOpExtension : public Extension { /** * @brief Destructor */ - ~BaseOpExtension() override; + virtual ~BaseOpExtension() override; }; namespace detail { diff --git a/src/core/src/so_extension.cpp b/src/core/src/so_extension.cpp index 0111e9fdd3f1a8..bc63845b9fb2c0 100644 --- a/src/core/src/so_extension.cpp +++ b/src/core/src/so_extension.cpp @@ -4,6 +4,10 @@ #include "openvino/core/so_extension.hpp" +ov::detail::SOExtension::~SOExtension() { + m_ext.reset(); +} + const ov::Extension::Ptr& ov::detail::SOExtension::extension() const { return m_ext; }