diff options
author | George Hazan <george.hazan@gmail.com> | 2013-06-12 19:05:01 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-06-12 19:05:01 +0000 |
commit | fe2c3dda8f60afa17a18f3f687b9d5eb04ed5d07 (patch) | |
tree | a01d9f2e147a713e8994c1cfcb4d3dccc7b3337c /protocols | |
parent | 9c63954b6766e378a841e7f32190a3278dc43e60 (diff) |
Skype memory leaks fixed
git-svn-id: http://svn.miranda-ng.org/main/trunk@4926 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Skype/src/skype.cpp | 5 | ||||
-rw-r--r-- | protocols/Skype/src/skype_database.cpp | 4 | ||||
-rw-r--r-- | protocols/Skype/src/skype_dialogs.cpp | 4 | ||||
-rw-r--r-- | protocols/Skype/src/skype_instances.cpp | 7 | ||||
-rw-r--r-- | protocols/Skype/src/skype_messages.cpp | 2 | ||||
-rw-r--r-- | protocols/Skype/src/skype_profile.cpp | 2 | ||||
-rw-r--r-- | protocols/Skype/src/skype_proto.h | 1 | ||||
-rw-r--r-- | protocols/Skype/src/string_list.h | 4 |
8 files changed, 15 insertions, 14 deletions
diff --git a/protocols/Skype/src/skype.cpp b/protocols/Skype/src/skype.cpp index 057350e3dd..04bed2caeb 100644 --- a/protocols/Skype/src/skype.cpp +++ b/protocols/Skype/src/skype.cpp @@ -208,9 +208,6 @@ extern "C" int __declspec(dllexport) Unload(void) {
CSkypeProto::UninitIcons();
CSkypeProto::UninitMenus();
-
- //this->stop();
- //delete this->skypeKit;
-
+ CSkypeProto::UninitInstances();
return 0;
}
\ No newline at end of file diff --git a/protocols/Skype/src/skype_database.cpp b/protocols/Skype/src/skype_database.cpp index 2aca8bd1f3..2ee7a22eca 100644 --- a/protocols/Skype/src/skype_database.cpp +++ b/protocols/Skype/src/skype_database.cpp @@ -92,7 +92,7 @@ void CSkypeProto::RaiseMessageSentEvent(HANDLE hContact, DWORD timestamp, SEBina int guidLen = (int)guid.size();
int msgLen = (int)::strlen(message) + 1;
- char *msg = (char *)::mir_alloc(msgLen + guidLen);
+ ptrA msg((char *)::mir_alloc(msgLen + guidLen));
::strcpy(msg, message);
msg[msgLen - 1] = 0;
@@ -108,5 +108,5 @@ void CSkypeProto::RaiseMessageSentEvent(HANDLE hContact, DWORD timestamp, SEBina timestamp,
flags,
msgLen + guidLen,
- (PBYTE)msg);
+ (PBYTE)(char*)msg);
}
diff --git a/protocols/Skype/src/skype_dialogs.cpp b/protocols/Skype/src/skype_dialogs.cpp index 7c7d88ebcf..883a0227e0 100644 --- a/protocols/Skype/src/skype_dialogs.cpp +++ b/protocols/Skype/src/skype_dialogs.cpp @@ -705,7 +705,7 @@ INT_PTR CALLBACK CSkypeProto::HomeSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wP {
if (g_countries[i].id != 0xFFFF && g_countries[i].id != 0)
{
- wchar_t *country = mir_a2t(g_countries[i].szName);
+ ptrT country( mir_a2t(g_countries[i].szName));
int nItem = ::SendMessage(
::GetDlgItem(hwndDlg, IDC_COUNTRY),
CB_ADDSTRING,
@@ -720,8 +720,6 @@ INT_PTR CALLBACK CSkypeProto::HomeSkypeDlgProc(HWND hwndDlg, UINT msg, WPARAM wP if (countr && ::wcscmp(country, countr) == 0)
::SendMessage(GetDlgItem(hwndDlg, IDC_COUNTRY), CB_SETCURSEL, nItem, 0);
-
- ::mir_free(country);
}
}
diff --git a/protocols/Skype/src/skype_instances.cpp b/protocols/Skype/src/skype_instances.cpp index bde45547b8..603a551a03 100644 --- a/protocols/Skype/src/skype_instances.cpp +++ b/protocols/Skype/src/skype_instances.cpp @@ -64,4 +64,9 @@ int CSkypeProto::UninitSkypeProto(CSkypeProto* ppro) delete ppro;
return 0;
-}
\ No newline at end of file +}
+
+void CSkypeProto::UninitInstances()
+{
+ instanceList.destroy();
+}
diff --git a/protocols/Skype/src/skype_messages.cpp b/protocols/Skype/src/skype_messages.cpp index 8a52946627..3619de3382 100644 --- a/protocols/Skype/src/skype_messages.cpp +++ b/protocols/Skype/src/skype_messages.cpp @@ -96,7 +96,7 @@ void CSkypeProto::OnMessageSent(const ConversationRef &conversation, const Messa message->GetPropConsumptionStatus(status);
message->GetPropBodyXml(data);
- char *text = CSkypeProto::RemoveHtml(data);
+ ptrA text( CSkypeProto::RemoveHtml(data));
CParticipant::Refs participants;
conversation->GetParticipants(participants, CConversation::OTHER_CONSUMERS);
diff --git a/protocols/Skype/src/skype_profile.cpp b/protocols/Skype/src/skype_profile.cpp index 391dbff192..ba77799948 100644 --- a/protocols/Skype/src/skype_profile.cpp +++ b/protocols/Skype/src/skype_profile.cpp @@ -112,7 +112,7 @@ void CSkypeProto::UpdateProfileCountry(SEObject *obj, HANDLE hContact) else
{
country = (char *)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, (WPARAM)isocode, 0);
- ::db_set_ws(hContact, this->m_szModuleName, "Country", ::mir_a2t(country));
+ ::db_set_ws(hContact, this->m_szModuleName, "Country", _A2T(country));
}
}
diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index 38f68e9557..c87cb73307 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -146,6 +146,7 @@ public: static int UninitSkypeProto(CSkypeProto* ppro);
static CSkypeProto* GetInstanceByHContact(HANDLE hContact);
+ static void UninitInstances();
// icons
static void InitIcons();
diff --git a/protocols/Skype/src/string_list.h b/protocols/Skype/src/string_list.h index df1ce7b0fa..60921746b5 100644 --- a/protocols/Skype/src/string_list.h +++ b/protocols/Skype/src/string_list.h @@ -18,10 +18,10 @@ public: wchar_t *p = ::wcstok(data, delimeters);
if (p)
{
- this->strings.push_back(::mir_wstrdup(p));
+ this->strings.push_back(p);
while (p = wcstok(NULL, delimeters))
{
- this->strings.push_back(::mir_wstrdup(p));
+ this->strings.push_back(p);
}
}
::mir_free(data);
|