Skip to content

Commit 6bc38d6

Browse files
SCell555craftablescience
authored andcommitted
Fix lambda capture errors
1 parent 5ef180a commit 6bc38d6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/network.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Impl : public dap::net::Server {
5050
}
5151

5252
stopped = false;
53-
thread = std::thread([=] {
53+
thread = std::thread([=, this] {
5454
while (true) {
5555
if (auto rw = socket->accept()) {
5656
onConnect(rw);

src/session.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,10 @@ class Impl : public dap::Session {
344344
return {};
345345
}
346346

347-
return [=] {
347+
return [=, this] {
348348
handler(
349349
data,
350-
[=](const dap::TypeInfo* typeinfo, const void* data) {
350+
[=, this](const dap::TypeInfo* typeinfo, const void* data) {
351351
// onSuccess
352352
dap::json::Serializer s;
353353
s.object([&](dap::FieldSerializer* fs) {
@@ -366,7 +366,7 @@ class Impl : public dap::Session {
366366
handler(data, nullptr);
367367
}
368368
},
369-
[=](const dap::TypeInfo* typeinfo, const dap::Error& error) {
369+
[=, this](const dap::TypeInfo* typeinfo, const dap::Error& error) {
370370
// onError
371371
dap::json::Serializer s;
372372
s.object([&](dap::FieldSerializer* fs) {

0 commit comments

Comments
 (0)