Set bufferCallback_ back to nullptr upon HTTPSession shutdown
Summary: AsyncSocket::handleWrite may trigger HTTPSession::onWriteSuccess which may totally delete the HTTPSession. AsyncSocket::handleWrite also calls bufferCallback_->onEgressBufferCleared(). That bufferCallback_ is the HTTPSession. So in this diff resets bufferCallback_ to nullptr upon HTTPSession shutdown. afrind had a suggestion of adding a DestructorGuard in AsyncSocket::handleWrite. But i don't know DestructorGuard that well. I think it will keep AsyncSocket from being deleted but not the HTTPSession? Or maybe I can DestructorGuard dg(bufferCallback_) ? Reviewed By: afrind Differential Revision: D3311058 fbshipit-source-id: cdb5fcbd53837a3effbc096eab87fca4e5d17291
Showing
Please register or sign in to comment