Use fewer keep-alives in VirtualEventBase::keepAliveRelease
[folly.git] / folly / io / async / VirtualEventBase.h
index ebf928aa6fc767401a616139e66df05595425042..539e77060a11e9d04918d218551e1616617cf8f9 100644 (file)
@@ -140,8 +140,8 @@ class VirtualEventBase : public folly::Executor, public folly::TimeoutManager {
   }
 
   void keepAliveRelease() override {
-    if (!inRunningEventBaseThread()) {
-      return add([=] { keepAliveRelease(); });
+    if (!evb_.inRunningEventBaseThread()) {
+      return evb_.add([=] { keepAliveRelease(); });
     }
     if (loopKeepAliveCountAtomic_.load()) {
       loopKeepAliveCount_ += loopKeepAliveCountAtomic_.exchange(0);