diff --git a/lo/lo_cpp.h b/lo/lo_cpp.h index 0332cbc..8f2b796 100644 --- a/lo/lo_cpp.h +++ b/lo/lo_cpp.h @@ -634,8 +634,9 @@ namespace lo { { LO_CHECK_BEFORE; for (auto &i : _handlers) { - std::remove_if(i.second.begin(), i.second.end(), + auto it = std::remove_if(i.second.begin(), i.second.end(), [&](std::unique_ptr& h){return h->method == m;}); + i.second.erase(it, i.second.end()); } return lo_server_del_lo_method(server, m); }