Summary: We need to prevent the socket from being deleted while in the loopCallback.
Test Plan: -- fbconfig '--sanitize' 'address' 'folly/io/async/test' && fbmake runtests
Reviewed By: davejwatson@fb.com
Subscribers: trunkagent, folly-diffs@, yfeldblum, chalfant
FB internal diff:
D2109031
Tasks:
7250307
Signature: t1:
2109031:
1432918801:
77f0352254925d3f33f1e004c8bba89cde63e2cf
Blame Revision:
D2102601
public:
explicit ImmediateReadCB(AsyncSocket* socket) : socket_(socket) {}
void runLoopCallback() noexcept override {
+ DestructorGuard dg(socket_);
socket_->checkForImmediateRead();
}
private: