diff options
author | George Hazan <ghazan@miranda.im> | 2021-05-04 20:42:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2021-05-04 20:42:25 +0300 |
commit | 68c7bf3b55ca132143686ab433659c3b828760aa (patch) | |
tree | 5e2b5f5bc674f05a4c351a8f4f0ea6b6e596ca16 /protocols/EmLanProto | |
parent | ef6ef30fac86de58bfd7d52b1d8a213b8d955d5d (diff) |
attempt to fix some problems on exit
Diffstat (limited to 'protocols/EmLanProto')
-rw-r--r-- | protocols/EmLanProto/src/lan.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/protocols/EmLanProto/src/lan.cpp b/protocols/EmLanProto/src/lan.cpp index 157470f2b0..deff7edd18 100644 --- a/protocols/EmLanProto/src/lan.cpp +++ b/protocols/EmLanProto/src/lan.cpp @@ -146,7 +146,7 @@ void CLan::StartListen() return;
}
- m_hListenThread = mir_forkthread(ListenProc, this);
+ mir_forkthread(ListenProc, this);
m_hAcceptTCPThread = mir_forkthread(AcceptTCPProc, this);
if (m_hListenThread == nullptr || m_hAcceptTCPThread == nullptr) {
m_mode = LM_ON;
@@ -176,6 +176,8 @@ void __cdecl CLan::ListenProc(void *lpParameter) void CLan::Listen()
{
+ MThreadHandle threadLock(m_hListenThread);
+
if (m_mode == LM_LISTEN) {
char buf[65536];
while (true) {
|