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 | |
| parent | ef6ef30fac86de58bfd7d52b1d8a213b8d955d5d (diff) | |
attempt to fix some problems on exit
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/EmLanProto/src/lan.cpp | 4 | ||||
| -rw-r--r-- | protocols/JabberG/src/jabber_console.cpp | 3 |
2 files changed, 5 insertions, 2 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) {
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 4e7a1e05bb..7a03299590 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -571,6 +571,7 @@ public: void __cdecl CJabberProto::ConsoleThread(void*)
{
Thread_SetName("Jabber: ConsoleThread");
+ MThreadHandle threadLock(m_hThreadConsole);
MSG msg;
while (GetMessage(&msg, nullptr, 0, 0)) {
@@ -588,7 +589,7 @@ void __cdecl CJabberProto::ConsoleThread(void*) void CJabberProto::ConsoleInit()
{
- m_hThreadConsole = ForkThreadEx(&CJabberProto::ConsoleThread, nullptr, &m_dwConsoleThreadId);
+ ForkThreadEx(&CJabberProto::ConsoleThread, nullptr, &m_dwConsoleThreadId);
}
void CJabberProto::ConsoleUninit()
|
