diff options
author | Mai M <mathew1800@gmail.com> | 2022-06-07 05:58:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-07 05:58:34 +0200 |
commit | 31527ccd2551b3c1e4f6b136f4e60faf5e2c2e73 (patch) | |
tree | fba810b9595c2330635d9a038711ff0b03f90486 /src/core | |
parent | Merge pull request #8367 from Docteh/say_win11 (diff) | |
parent | core/debugger: fix crash due to incorrect lambda capture (diff) | |
download | yuzu-31527ccd2551b3c1e4f6b136f4e60faf5e2c2e73.tar yuzu-31527ccd2551b3c1e4f6b136f4e60faf5e2c2e73.tar.gz yuzu-31527ccd2551b3c1e4f6b136f4e60faf5e2c2e73.tar.bz2 yuzu-31527ccd2551b3c1e4f6b136f4e60faf5e2c2e73.tar.lz yuzu-31527ccd2551b3c1e4f6b136f4e60faf5e2c2e73.tar.xz yuzu-31527ccd2551b3c1e4f6b136f4e60faf5e2c2e73.tar.zst yuzu-31527ccd2551b3c1e4f6b136f4e60faf5e2c2e73.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/debugger/debugger.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/debugger/debugger.cpp b/src/core/debugger/debugger.cpp index 68ab33e46..69b7d987d 100644 --- a/src/core/debugger/debugger.cpp +++ b/src/core/debugger/debugger.cpp @@ -20,15 +20,16 @@ template <typename Readable, typename Buffer, typename Callback> static void AsyncReceiveInto(Readable& r, Buffer& buffer, Callback&& c) { static_assert(std::is_trivial_v<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) { - if (!error.failed()) { - const u8* buffer_start = reinterpret_cast<const u8*>(&buffer); - std::span<const u8> received_data{buffer_start, buffer_start + bytes_read}; - c(received_data); - } + r.async_read_some( + boost_buffer, [&, c](const boost::system::error_code& error, size_t bytes_read) { + if (!error.failed()) { + const u8* buffer_start = reinterpret_cast<const u8*>(&buffer); + 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> |