summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-02-16 16:56:14 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-02-16 16:56:14 +0300
commit2331374d1ffe2432496e484443a58e859a7f560f (patch)
tree8c8cf662bb9e8df29b7fb1969e016dcc9632a04a /protocols/Discord/src/proto.cpp
parent65783c3a344eaf555e46ab77dc9f3603cc07ce48 (diff)
Discord: the safer way of handling web sockets
Diffstat (limited to 'protocols/Discord/src/proto.cpp')
-rw-r--r--protocols/Discord/src/proto.cpp5
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);