mirror of
https://github.com/boostorg/beast.git
synced 2025-07-29 20:37:31 +02:00
Fix invokable order of invocation:
The call to the final handler in a composed operation MUST be the last thing performed, as the handler may cause the end of object lifetimes before it returns.
This commit is contained in:
@ -175,8 +175,8 @@ stream<NextLayer>::close_op<Handler>::operator()(
|
||||
d.ws.error_ = true;
|
||||
if(d.ws.wr_block_ == &d)
|
||||
d.ws.wr_block_ = nullptr;
|
||||
d.h(ec);
|
||||
d.ws.rd_op_.maybe_invoke();
|
||||
d.h(ec);
|
||||
}
|
||||
|
||||
} // websocket
|
||||
|
@ -497,8 +497,8 @@ operator()(error_code ec,std::size_t bytes_transferred, bool again)
|
||||
d.ws.error_ = true;
|
||||
if(d.ws.wr_block_ == &d)
|
||||
d.ws.wr_block_ = nullptr;
|
||||
d.h(ec);
|
||||
d.ws.wr_op_.maybe_invoke();
|
||||
d.h(ec);
|
||||
}
|
||||
|
||||
} // websocket
|
||||
|
@ -256,8 +256,8 @@ operator()(
|
||||
deallocate(d.tmp, d.tmp_size, d.h);
|
||||
d.tmp = nullptr;
|
||||
}
|
||||
d.h(ec);
|
||||
d.ws.rd_op_.maybe_invoke();
|
||||
d.h(ec);
|
||||
}
|
||||
|
||||
} // websocket
|
||||
|
Reference in New Issue
Block a user