From 38a93d167307c8d1912abeaf32182abe97a03598 Mon Sep 17 00:00:00 2001 From: Piotr Piastucki Date: Tue, 19 May 2015 21:00:49 +0000 Subject: Fixed some memleaks. Added contact list exchange feature. git-svn-id: http://svn.miranda-ng.org/main/trunk@13704 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/src/msn_avatar.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'protocols/MSN/src/msn_avatar.cpp') diff --git a/protocols/MSN/src/msn_avatar.cpp b/protocols/MSN/src/msn_avatar.cpp index 8f871b43ec..cc0a480418 100644 --- a/protocols/MSN/src/msn_avatar.cpp +++ b/protocols/MSN/src/msn_avatar.cpp @@ -22,7 +22,7 @@ along with this program. If not, see . void CMsnProto::AvatarQueue_Init() { - hevAvatarQueue = ::CreateEvent(NULL, FALSE, FALSE, NULL); + hevAvatarQueue = ::CreateSemaphore(NULL, 0, 255, NULL); ForkThread(&CMsnProto::MSN_AvatarsThread, 0); } @@ -44,7 +44,7 @@ void CMsnProto::pushAvatarRequest(MCONTACT hContact, LPCSTR pszUrl) return; lsAvatarQueue.insert(new AvatarQueueEntry(hContact, pszUrl)); - SetEvent(hevAvatarQueue); + ReleaseSemaphore(hevAvatarQueue, 1, NULL); } } @@ -119,4 +119,11 @@ void __cdecl CMsnProto::MSN_AvatarsThread(void*) ProtoBroadcastAck(p->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, 0, 0); delete p; } + { + mir_cslock lck(csAvatarQueue); + while (lsAvatarQueue.getCount() > 0) { + delete lsAvatarQueue[0]; + lsAvatarQueue.remove(0); + } + } } -- cgit v1.2.3