diff options
author | Piotr Piastucki <leech.miranda@gmail.com> | 2015-05-19 21:00:49 +0000 |
---|---|---|
committer | Piotr Piastucki <leech.miranda@gmail.com> | 2015-05-19 21:00:49 +0000 |
commit | 38a93d167307c8d1912abeaf32182abe97a03598 (patch) | |
tree | 2602113bb73b15a4cd1a272a2d8464d60141c844 /protocols/MSN/src/msn_avatar.cpp | |
parent | 05463e65c1fa74da551b9acf701366e185e516fc (diff) |
Fixed some memleaks.
Added contact list exchange feature.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13704 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN/src/msn_avatar.cpp')
-rw-r--r-- | protocols/MSN/src/msn_avatar.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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 <http://www.gnu.org/licenses/>. 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);
+ }
+ }
}
|