summaryrefslogtreecommitdiff
path: root/protocols/Tox/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/src')
-rw-r--r--protocols/Tox/src/stdafx.h6
-rw-r--r--protocols/Tox/src/tox_connection.cpp9
2 files changed, 9 insertions, 6 deletions
diff --git a/protocols/Tox/src/stdafx.h b/protocols/Tox/src/stdafx.h
index 367108e1ad..5e4af6b0c9 100644
--- a/protocols/Tox/src/stdafx.h
+++ b/protocols/Tox/src/stdafx.h
@@ -59,12 +59,10 @@ extern HINSTANCE g_hInstance;
#define MODULE "Tox"
-#define TOX_API_VER_MAJOR 0
-#define TOX_API_VER_MINOR 1
-#define TOX_API_VER_PATCH 5
-
#define TOX_ERROR -1
+#define TOX_DEFAULT_INTERVAL 50
+
#define TOX_MAX_CONNECT_RETRIES 10
#define TOX_MAX_RECONNECT_RETRIES 10
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;