Prevent use after free

Former-commit-id: 81573de393eef083d2209117b270d088a7b3f819
This commit is contained in:
John Sully 2020-12-11 03:59:26 +00:00
parent 69f375c45b
commit 51ef4343c4

View File

@ -4025,8 +4025,8 @@ bool client::postFunction(std::function<void(client *)> fn, bool fLock) {
this->casyncOpsPending++; this->casyncOpsPending++;
return aePostFunction(g_pserver->rgthreadvar[this->iel].el, [this, fn]{ return aePostFunction(g_pserver->rgthreadvar[this->iel].el, [this, fn]{
std::lock_guard<decltype(this->lock)> lock(this->lock); std::lock_guard<decltype(this->lock)> lock(this->lock);
--casyncOpsPending;
fn(this); fn(this);
--casyncOpsPending;
}, false, fLock) == AE_OK; }, false, fLock) == AE_OK;
} }