x->add([this]() mutable {
SCOPE_EXIT { detachOne(); };
RequestContext::setContext(context_);
+ SCOPE_EXIT { callback_ = {}; };
callback_(std::move(*result_));
});
} else {
x->addWithPriority([this]() mutable {
SCOPE_EXIT { detachOne(); };
RequestContext::setContext(context_);
+ SCOPE_EXIT { callback_ = {}; };
callback_(std::move(*result_));
}, priority);
}
--attached_; // Account for extra ++attached_ before try
RequestContext::setContext(context_);
result_ = Try<T>(exception_wrapper(std::current_exception()));
+ SCOPE_EXIT { callback_ = {}; };
callback_(std::move(*result_));
}
} else {
RequestContext::setContext(context_);
+ SCOPE_EXIT { callback_ = {}; };
callback_(std::move(*result_));
}
}