mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-11-15 08:32:52 +00:00
Merge pull request #8435 from liamwhite/lambda-capture
core/debugger: fix crash due to incorrect lambda capture
This commit is contained in:
commit
31527ccd25
|
@ -20,15 +20,16 @@ template <typename Readable, typename Buffer, typename Callback>
|
||||||
static void AsyncReceiveInto(Readable& r, Buffer& buffer, Callback&& c) {
|
static void AsyncReceiveInto(Readable& r, Buffer& buffer, Callback&& c) {
|
||||||
static_assert(std::is_trivial_v<Buffer>);
|
static_assert(std::is_trivial_v<Buffer>);
|
||||||
auto boost_buffer{boost::asio::buffer(&buffer, sizeof(Buffer))};
|
auto boost_buffer{boost::asio::buffer(&buffer, sizeof(Buffer))};
|
||||||
r.async_read_some(boost_buffer, [&](const boost::system::error_code& error, size_t bytes_read) {
|
r.async_read_some(
|
||||||
if (!error.failed()) {
|
boost_buffer, [&, c](const boost::system::error_code& error, size_t bytes_read) {
|
||||||
const u8* buffer_start = reinterpret_cast<const u8*>(&buffer);
|
if (!error.failed()) {
|
||||||
std::span<const u8> received_data{buffer_start, buffer_start + bytes_read};
|
const u8* buffer_start = reinterpret_cast<const u8*>(&buffer);
|
||||||
c(received_data);
|
std::span<const u8> received_data{buffer_start, buffer_start + bytes_read};
|
||||||
}
|
c(received_data);
|
||||||
|
}
|
||||||
|
|
||||||
AsyncReceiveInto(r, buffer, c);
|
AsyncReceiveInto(r, buffer, c);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Readable, typename Buffer>
|
template <typename Readable, typename Buffer>
|
||||||
|
|
Loading…
Reference in a new issue