Commit 3b5be68e authored by legoc's avatar legoc
Browse files

Reviewed m_impl pointer in Services

parent 0c425dd6
......@@ -31,8 +31,7 @@ namespace cameo {
Server::Server(const std::string& endpoint) :
Services() {
m_impl = new ServicesImpl();
Services::setImpl(m_impl);
Services::setImpl(new ServicesImpl());
vector<string> tokens = split(endpoint);
......
......@@ -102,8 +102,6 @@ private:
std::unique_ptr<application::Instance> stop(int id, bool immediately);
std::unique_ptr<application::Subscriber> createSubscriber(int id, const std::string& publisherName, const std::string& instanceName) const;
int getAvailableTimeout() const;
ServicesImpl * m_impl;
};
std::ostream& operator<<(std::ostream&, const Server&);
......
......@@ -40,12 +40,11 @@ Services::~Services() {
}
void Services::terminate() {
delete m_impl;
m_impl = nullptr;
m_impl.reset();
}
void Services::setImpl(ServicesImpl * impl) {
m_impl = impl;
m_impl.reset(impl);
}
std::vector<std::string> Services::split(const std::string& info) {
......
......@@ -52,7 +52,7 @@ public:
int m_port;
int m_statusPort;
std::string m_serverStatusEndpoint;
ServicesImpl * m_impl;
std::unique_ptr<ServicesImpl> m_impl;
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment