MXS-2196: Use smart pointers for lifetime management

The listeners no longer internally track whether they are active or
not. All of the heavy lifting is now done by std::shared_ptr.
This commit is contained in:
Markus Mäkelä
2018-11-30 11:53:17 +02:00
parent a10b6c2e89
commit c858f7f080
3 changed files with 20 additions and 60 deletions

View File

@ -236,12 +236,6 @@ Service::~Service()
{
mxs_rworker_delete_data(m_wkey);
for (const auto& tmp : listener_find_by_service(this))
{
mxb_assert(!tmp->is_active() || maxscale_teardown_in_progress());
listener_free(listener_find(tmp->name()));
}
if (router && router_instance && router->destroyInstance)
{
router->destroyInstance(router_instance);
@ -538,7 +532,7 @@ bool service_remove_listener(Service* service, const char* target)
if (listener && listener->service() == service)
{
listener->close();
Listener::destroy(listener);
rval = true;
}