This patch does not remove the plugin unique_ptr directly.
Instead, it passes it in so that it is removed according to the unique_ptr policy.
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
public:
std::unique_ptr<Backend> create(const CmdlineArguments &args) const;
-public:
- void close(void) const;
-
private:
void *_handle;
Entry _entry;
plugin._entry = nullptr;
}
-BackendPlugin::~BackendPlugin() { close(); }
-
-std::unique_ptr<Backend> BackendPlugin::create(const CmdlineArguments &args) const
-{
- return _entry(args);
-}
-
-void BackendPlugin::close(void) const
+BackendPlugin::~BackendPlugin()
{
if (_handle != nullptr)
{
}
}
+std::unique_ptr<Backend> BackendPlugin::create(const CmdlineArguments &args) const
+{
+ return _entry(args);
+}
+
std::unique_ptr<BackendPlugin> make_backend_plugin(const std::string &path)
{
if (path.empty())
_plugin = std::move(nnkit::make_backend_plugin(_path));
return _plugin->create(args());
}
- void finalize(void) const { _plugin->close(); }
private:
std::string _path;
}
});
- // Finalize a backend
- sections.backend->finalize();
-
return 0;
}