diff options
author | aunsane <aunsane@gmail.com> | 2017-03-15 00:19:35 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-03-15 00:19:35 +0300 |
commit | 5de53491d607c38286b19989ba7182454f24fabc (patch) | |
tree | cb0da96d057fd1f85245ca3ff3423ea3300da060 /protocols/Tox/src/tox_proto.cpp | |
parent | a76c706113f6d9e1a1a253feab46051fb2e6ce12 (diff) |
Tox:
- tox_network.cpp splitted on two logical parts
- tox network status checking moved to separated thread
- started rejection of toxThread wrapper
Diffstat (limited to 'protocols/Tox/src/tox_proto.cpp')
-rw-r--r-- | protocols/Tox/src/tox_proto.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index 5209e3ef92..8090043ffe 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -2,8 +2,9 @@ CToxProto::CToxProto(const char* protoName, const wchar_t* userName)
: PROTO<CToxProto>(protoName, userName),
- hPollingThread(NULL), toxThread(NULL),
- hOutDevice(NULL), hMessageProcess(1)
+ toxThread(NULL), isTerminated(false),
+ hCheckingThread(NULL), hPollingThread(NULL),
+ hMessageProcess(1)
{
InitNetlib();
@@ -26,7 +27,9 @@ CToxProto::CToxProto(const char* protoName, const wchar_t* userName) // nick
CreateProtoService(PS_SETMYNICKNAME, &CToxProto::SetMyNickname);
- hAudioDialogs = WindowList_Create();
+ //hAudioDialogs = WindowList_Create();
+
+ hTerminateEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
}
CToxProto::~CToxProto()
@@ -151,11 +154,8 @@ int CToxProto::SetStatus(int iNewStatus) if (iNewStatus == ID_STATUS_OFFLINE)
{
// logout
- if (toxThread)
- {
- toxThread->Stop();
- toxThread = NULL;
- }
+ isTerminated = true;
+ SetEvent(hTerminateEvent);
if (!Miranda_IsTerminated())
{
|