diff --git a/wangle/service/Service.h b/wangle/service/Service.h index 900b7706c..c6e9a5d10 100644 --- a/wangle/service/Service.h +++ b/wangle/service/Service.h @@ -144,7 +144,7 @@ class FactoryToService : public Service { folly::Future operator()(Req request) override { DCHECK(factory_); return ((*factory_)(nullptr)) - .thenValue([=](std::shared_ptr> service) { + .thenValue([=, this](std::shared_ptr> service) { return (*service)(std::move(request)).ensure([this]() { this->close(); });