From 5a53bd449acb3efb18984f6732817f2888c7cc7f Mon Sep 17 00:00:00 2001 From: Christos Stratopoulos Date: Wed, 28 Feb 2018 15:14:47 -0500 Subject: [PATCH] Don't copy the handler in write_some_op --- CHANGELOG.md | 6 ++++++ include/boost/beast/websocket/impl/write.ipp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d72aa3a..83d46800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 161: + +* Don't copy the handler in write_some_op + +-------------------------------------------------------------------------------- + Version 160: * Examples clear the HTTP message before reading diff --git a/include/boost/beast/websocket/impl/write.ipp b/include/boost/beast/websocket/impl/write.ipp index a34f66e9..5d4a9d68 100644 --- a/include/boost/beast/websocket/impl/write.ipp +++ b/include/boost/beast/websocket/impl/write.ipp @@ -561,7 +561,7 @@ operator()( if(! cont_) return boost::asio::post( ws_.stream_.get_executor(), - bind_handler(h_, ec, bytes_transferred_)); + bind_handler(std::move(h_), ec, bytes_transferred_)); h_(ec, bytes_transferred_); } }