Skip to content

Commit e9fbdd5

Browse files
committed
Fix crashes
1 parent 36d8a68 commit e9fbdd5

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

src/kz/global/handshake.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@ namespace KZ::API::handshake
3737
struct ModeInfo
3838
{
3939
Mode mode;
40-
std::string linuxChecksum;
41-
std::string windowsChecksum;
40+
std::string linuxChecksum {};
41+
std::string windowsChecksum {};
4242

4343
bool FromJson(const Json &json);
4444
};
4545

4646
struct StyleInfo
4747
{
4848
Style style;
49-
std::string linuxChecksum;
50-
std::string windowsChecksum;
49+
std::string linuxChecksum {};
50+
std::string windowsChecksum {};
5151

5252
bool FromJson(const Json &json);
5353
};
5454

5555
// seconds
56-
f64 heartbeatInterval;
57-
std::optional<KZ::API::Map> mapInfo;
58-
std::vector<ModeInfo> modes;
59-
std::vector<StyleInfo> styles;
56+
f64 heartbeatInterval {};
57+
std::optional<KZ::API::Map> mapInfo {};
58+
std::vector<ModeInfo> modes {};
59+
std::vector<StyleInfo> styles {};
6060

6161
bool FromJson(const Json &json);
6262
};

src/kz/global/kz_global.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -488,13 +488,7 @@ void KZGlobalService::OnWebSocketMessage(const ix::WebSocketMessagePtr &message)
488488
break;
489489
}
490490

491-
// clang-format off
492-
KZGlobalService::AddMainThreadCallback([=]()
493-
{
494-
KZ::API::handshake::HelloAck helloAck = helloAck;
495-
KZGlobalService::CompleteHandshake(helloAck);
496-
});
497-
// clang-format on
491+
KZGlobalService::AddMainThreadCallback([ack = std::move(helloAck)]() mutable { KZGlobalService::CompleteHandshake(ack); });
498492
}
499493
break;
500494

0 commit comments

Comments
 (0)