summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libadhocutil/plugins.cpp2
-rw-r--r--libadhocutil/plugins.h2
-rw-r--r--libadhocutil/unittests/testPlugins.cpp5
3 files changed, 8 insertions, 1 deletions
diff --git a/libadhocutil/plugins.cpp b/libadhocutil/plugins.cpp
index 9c13bf4..86dc2c5 100644
--- a/libadhocutil/plugins.cpp
+++ b/libadhocutil/plugins.cpp
@@ -85,6 +85,8 @@ namespace AdHoc {
{
}
+ PluginManager::~PluginManager() = default;
+
PluginManager *
PluginManager::getDefault()
{
diff --git a/libadhocutil/plugins.h b/libadhocutil/plugins.h
index 42d6062..ce3447a 100644
--- a/libadhocutil/plugins.h
+++ b/libadhocutil/plugins.h
@@ -100,7 +100,7 @@ namespace AdHoc {
typedef std::function<std::optional<std::string> (const std::type_info &, const std::string_view &)> PluginResolver;
PluginManager();
- virtual ~PluginManager() = default;
+ virtual ~PluginManager();
/// Install a plugin.
void add(const PluginPtr &);
diff --git a/libadhocutil/unittests/testPlugins.cpp b/libadhocutil/unittests/testPlugins.cpp
index 8d35822..bdcfe6d 100644
--- a/libadhocutil/unittests/testPlugins.cpp
+++ b/libadhocutil/unittests/testPlugins.cpp
@@ -17,6 +17,11 @@ BOOST_AUTO_TEST_CASE( registered )
BOOST_REQUIRE_EQUAL(1, PluginManager::getDefault()->count());
}
+BOOST_AUTO_TEST_CASE( private_instance )
+{
+ std::make_unique<PluginManager>();
+}
+
BOOST_AUTO_TEST_CASE( get )
{
auto implOfThingPlugin = PluginManager::getDefault()->get<BaseThing>("ImplOfThing");