From dda141f0798b79cfa71e78934ed1b968fcc20f53 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 14 Sep 2015 19:34:42 +0000 Subject: Tox: fixed tox thread management git-svn-id: http://svn.miranda-ng.org/main/trunk@15354 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_proto.h | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'protocols/Tox/src/tox_proto.h') diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index f465dcd713..f9efa6a059 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -1,21 +1,6 @@ #ifndef _TOX_PROTO_H_ #define _TOX_PROTO_H_ -struct ToxThreadData -{ - Tox *tox; - ToxAv *toxAv; - bool isConnected; - bool isTerminated; - - mir_cs toxLock; - - ToxThreadData() : tox(NULL), toxAv(NULL), - isConnected(false), isTerminated(false) { } - - void Stop() { isTerminated = true; } -}; - struct CToxProto : public PROTO { friend CToxPasswordEditor; @@ -82,7 +67,7 @@ public: static int OnModulesLoaded(WPARAM, LPARAM); private: - ToxThreadData *toxThread; + CToxThread *toxThread; mir_cs profileLock; TCHAR *accountName; HANDLE hNetlib, hPollingThread; @@ -102,8 +87,8 @@ private: // tox core Tox_Options* GetToxOptions(); - bool InitToxCore(ToxThreadData *toxThread); - void UninitToxCore(ToxThreadData *toxThread); + bool InitToxCore(CToxThread *toxThread); + void UninitToxCore(); // tox network bool IsOnline(); @@ -247,6 +232,7 @@ private: void PauseOutgoingTransfers(uint32_t friendNumber); void ResumeIncomingTransfers(uint32_t friendNumber); + void CancelAllTransfers(); // avatars TCHAR* GetAvatarFilePath(MCONTACT hContact = NULL); -- cgit v1.2.3