Summary:
Baton::post has to be the last step of Promise::setTry. If Promise is not owned by
the posting thread, it may be destroyed right after Baton::post is called.
Reviewed By: pavlo-fb
Differential Revision:
D3312506
fbshipit-source-id:
6d5c3f0925c3bb9cd3f981e7550f888d5ed76189
*value_ = std::move(t);
value_ = nullptr;
+ // Baton::post has to be the last step here, since if Promise is not owned by
+ // the posting thread, it may be destroyed right after Baton::post is called.
baton_->post();
-
- baton_ = nullptr;
}
template <class T>