diff options
author | George Hazan <george.hazan@gmail.com> | 2025-02-16 16:56:14 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2025-02-16 16:56:14 +0300 |
commit | 2331374d1ffe2432496e484443a58e859a7f560f (patch) | |
tree | 8c8cf662bb9e8df29b7fb1969e016dcc9632a04a /protocols/Discord/src/proto.cpp | |
parent | 65783c3a344eaf555e46ab77dc9f3603cc07ce48 (diff) |
Discord: the safer way of handling web sockets
Diffstat (limited to 'protocols/Discord/src/proto.cpp')
-rw-r--r-- | protocols/Discord/src/proto.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index f1df2c2a12..5a33a9d6f5 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -44,6 +44,7 @@ static int compareCalls(const CDiscordVoiceCall *p1, const CDiscordVoiceCall *p2 CDiscordProto::CDiscordProto(const char *proto_name, const wchar_t *username) :
PROTO<CDiscordProto>(proto_name, username),
+ m_ws(this),
m_impl(*this),
m_arHttpQueue(10, compareRequests),
m_evRequestsQueue(CreateEvent(nullptr, FALSE, FALSE, nullptr)),
@@ -174,8 +175,8 @@ void CDiscordProto::OnShutdown() for (auto &it : arGuilds)
it->SaveToFile();
- if (m_ws)
- m_ws->terminate();
+ if (m_bConnected)
+ m_ws.terminate();
if (g_plugin.bVoiceService)
CallService(MS_VOICESERVICE_UNREGISTER, (WPARAM)m_szModuleName, 0);
|