diff options
Diffstat (limited to 'protocols/Tox/src/tox_connection.cpp')
-rw-r--r-- | protocols/Tox/src/tox_connection.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/protocols/Tox/src/tox_connection.cpp b/protocols/Tox/src/tox_connection.cpp index f846866242..392f7bbbb6 100644 --- a/protocols/Tox/src/tox_connection.cpp +++ b/protocols/Tox/src/tox_connection.cpp @@ -109,11 +109,16 @@ void CToxProto::PollingThread(void*) while (!isTerminated) { tox_iterate(toxThread.Tox(), this); uint32_t interval = tox_iteration_interval(toxThread.Tox()); - interval = interval ? interval : 50; - + interval = interval + ? interval + : TOX_DEFAULT_INTERVAL; WaitForSingleObject(hTerminateEvent, interval); } + SetEvent(hTerminateEvent); + + Sleep(TOX_DEFAULT_INTERVAL * 10); + UninitToxCore(toxThread.Tox()); m_toxThread = nullptr; hPollingThread = nullptr; |