From 23681d2dcf763b993b932451dea7a2772fca81ad Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sat, 1 Aug 2015 12:26:05 +0000 Subject: SkypeWeb: crashfix git-svn-id: http://svn.miranda-ng.org/main/trunk@14778 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_contacts.cpp | 11 ++++------- protocols/SkypeWeb/src/skype_proto.h | 2 ++ protocols/SkypeWeb/src/skype_utils.cpp | 6 ++++++ 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'protocols') diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index ba71ebc14f..9f5f7fe62d 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -287,7 +287,6 @@ void CSkypeProto::LoadContactList(const NETLIBHTTPREQUEST *response) } } - ptrA token(getStringA("TokenSecret")); if (skypenames.getCount() > 0) { int i = 0; @@ -297,19 +296,17 @@ void CSkypeProto::LoadContactList(const NETLIBHTTPREQUEST *response) for (; i < skypenames.getCount() && users.getCount() < 25; i++) users.insert(skypenames[i]); - PushRequest(new GetContactsInfoRequest(token, users), &CSkypeProto::LoadContactsInfo); + PushRequest(new GetContactsInfoRequest(m_szTokenSecret, users), &CSkypeProto::LoadContactsInfo); - for (int j = 0; j < users.getCount(); j++) - mir_free(users[j]); + FreeCharList(users); users.destroy(); } while(i < skypenames.getCount()); - for (i = 0; i < skypenames.getCount(); i++) - mir_free(skypenames[i]); + FreeCharList(skypenames); skypenames.destroy(); } - PushRequest(new GetContactsAuthRequest(token), &CSkypeProto::LoadContactsAuth); + PushRequest(new GetContactsAuthRequest(m_szTokenSecret), &CSkypeProto::LoadContactsAuth); } INT_PTR CSkypeProto::OnRequestAuth(WPARAM hContact, LPARAM) diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 6c3bcaa669..01f3ec57bf 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -305,6 +305,8 @@ private: void ProcessThreadUpdateRes(const JSONNode &node); // utils + void CSkypeProto::FreeCharList(LIST lst); + __forceinline bool IsOnline() { return (m_iStatus > ID_STATUS_OFFLINE && m_hPollingThread); } diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp index e833592caf..e1bb16f064 100644 --- a/protocols/SkypeWeb/src/skype_utils.cpp +++ b/protocols/SkypeWeb/src/skype_utils.cpp @@ -19,6 +19,12 @@ along with this program. If not, see . #pragma warning(disable:4566) +void CSkypeProto::FreeCharList(LIST lst) +{ + for (int i = 0; i < lst.getCount(); i++) + mir_free(lst[i]); +} + void CSkypeProto::SetSrmmReadStatus(MCONTACT hContact) { time_t time = getDword(hContact, "LastMsgReadTime", 0); -- cgit v1.2.3