RequestHandler object is now returned as reference rather than as pointer. Memory handling should be more clear by that change.
This commit is contained in:
parent
da3789f2ce
commit
2b639a5a14
@ -61,10 +61,8 @@ public:
|
||||
ioService.stop();
|
||||
}
|
||||
|
||||
|
||||
|
||||
RequestHandler * GetRequestHandlerPtr() {
|
||||
return &requestHandler;
|
||||
RequestHandler & GetRequestHandlerPtr() {
|
||||
return requestHandler;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -56,16 +56,16 @@ int main (int argc, char *argv[])
|
||||
|
||||
ServerConfiguration serverConfig("server.ini");
|
||||
Server * s = ServerFactory::CreateServer(serverConfig);
|
||||
RequestHandler * h = s->GetRequestHandlerPtr();
|
||||
RequestHandler & h = s->GetRequestHandlerPtr();
|
||||
|
||||
BasePlugin * helloWorld = new HelloWorldPlugin();
|
||||
h->RegisterPlugin(helloWorld);
|
||||
h.RegisterPlugin(helloWorld);
|
||||
|
||||
BasePlugin * locate = new LocatePlugin(
|
||||
serverConfig.GetParameter("ramIndex"),
|
||||
serverConfig.GetParameter("fileIndex"),
|
||||
serverConfig.GetParameter("nodesData"));
|
||||
h->RegisterPlugin(locate);
|
||||
h.RegisterPlugin(locate);
|
||||
|
||||
BasePlugin * route = new RoutePlugin(
|
||||
serverConfig.GetParameter("hsgrData"),
|
||||
@ -73,7 +73,7 @@ int main (int argc, char *argv[])
|
||||
serverConfig.GetParameter("fileIndex"),
|
||||
serverConfig.GetParameter("nodesData"),
|
||||
serverConfig.GetParameter("namesData"));
|
||||
h->RegisterPlugin(route);
|
||||
h.RegisterPlugin(route);
|
||||
|
||||
boost::thread t(boost::bind(&Server::Run, s));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user