summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/base.h4
-rw-r--r--src/base.cpp4
-rw-r--r--src/modules.cpp2
3 files changed, 9 insertions, 1 deletions
diff --git a/include/base.h b/include/base.h
index dcbb2e5c7..8aa6269d3 100644
--- a/include/base.h
+++ b/include/base.h
@@ -251,6 +251,10 @@ class CoreExport ServiceProvider : public classbase
ServiceProvider(Module* Creator, const std::string& Name, ServiceType Type);
virtual ~ServiceProvider();
+ /** Register this service in the appropriate registrar
+ */
+ virtual void RegisterService();
+
/** If called, this ServiceProvider won't be registered automatically
*/
void DisableAutoRegister();
diff --git a/src/base.cpp b/src/base.cpp
index 67b136ec8..63b14256e 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -95,6 +95,10 @@ ServiceProvider::~ServiceProvider()
{
}
+void ServiceProvider::RegisterService()
+{
+}
+
ExtensionItem::ExtensionItem(const std::string& Key, ExtensibleType exttype, Module* mod)
: ServiceProvider(mod, Key, SERVICE_METADATA)
, type(exttype)
diff --git a/src/modules.cpp b/src/modules.cpp
index 0223d12f1..3ff8aad14 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -588,7 +588,7 @@ void ModuleManager::AddService(ServiceProvider& item)
return;
}
default:
- throw ModuleException("Cannot add unknown service type");
+ item.RegisterService();
}
}