From e2cfe2842bd2645185a00ee93cdec74ffce3fc97 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 5 Sep 2024 17:29:37 +0400 Subject: [PATCH] Fixed extensions (tokenizers) loading on Android (#26436) ### Details: - Ported https://github.com/openvinotoolkit/openvino/pull/26437 --- src/core/dev_api/openvino/core/so_extension.hpp | 4 +--- src/core/include/openvino/core/op_extension.hpp | 2 +- src/core/src/so_extension.cpp | 4 ++++ 3 files changed, 6 insertions(+), 4 deletions(-) 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; }