diff options
Diffstat (limited to 'modules/m_xmlrpc.cpp')
-rw-r--r-- | modules/m_xmlrpc.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/m_xmlrpc.cpp b/modules/m_xmlrpc.cpp index 36401b800..1d08bed43 100644 --- a/modules/m_xmlrpc.cpp +++ b/modules/m_xmlrpc.cpp @@ -162,11 +162,8 @@ class ModuleXMLRPC : public Module MyXMLRPCServiceInterface xmlrpcinterface; ModuleXMLRPC(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, EXTRA | VENDOR), - httpref("HTTPProvider", "httpd/main"), xmlrpcinterface(this, "xmlrpc") + xmlrpcinterface(this, "xmlrpc") { - if (!httpref) - throw ModuleException("Unable to find http reference, is m_httpd loaded?"); - httpref->RegisterPage(&xmlrpcinterface); } @@ -178,7 +175,12 @@ class ModuleXMLRPC : public Module void OnReload(Configuration::Conf *conf) anope_override { + if (httpref) + httpref->UnregisterPage(&xmlrpcinterface); this->httpref = ServiceReference<HTTPProvider>("HTTPProvider", conf->GetModule(this)->Get<const Anope::string>("server", "httpd/main")); + if (!httpref) + throw ConfigException("Unable to find http reference, is m_httpd loaded?"); + httpref->RegisterPage(&xmlrpcinterface); } }; |