From a19a07312430e3b61f8d80b72d7a3c58def02710 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 6 Mar 2015 21:27:20 +0000 Subject: more correct form of cycle git-svn-id: http://svn.miranda-ng.org/main/trunk@12361 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/IcqOscarJ/src/icq_avatar.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols/IcqOscarJ/src') diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index b5f49ee611..147d16a898 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -552,17 +552,17 @@ int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, if (m_avatarsConnection && m_avatarsConnection->isReady()) { // check if we are ready // check if requests for this user are not blocked - for (avatars_request *ar = m_avatarsQueue; ar; ar = ar->pNext) { + for (avatars_request *ar = m_avatarsQueue; ar; ) { if (ar->hContact == hContact && ar->type == ART_BLOCK) { // found a block item if (GetTickCount() > ar->timeOut) { // remove timeouted block - if ((ar = ReleaseAvatarRequestInQueue(ar)) == NULL) - break; + ar = ReleaseAvatarRequestInQueue(ar); continue; } m_avatarsMutex->Leave(); debugLogA("Avatars: Requests for %s avatar are blocked.", strUID(dwUin, pszUid)); return 0; } + ar = ar->pNext; } avatars_server_connection *pConnection = m_avatarsConnection; @@ -582,11 +582,10 @@ int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, // we failed to send request, or avatar thread not ready // check if any request for this user is not already in the queue - for (avatars_request *ar = m_avatarsQueue; ar; ar = ar->pNext) { + for (avatars_request *ar = m_avatarsQueue; ar; ) { if (ar->hContact == hContact) { // we found it, return error if (ar->type == ART_BLOCK && GetTickCount() > ar->timeOut) { // remove timeouted block - if ((ar = ReleaseAvatarRequestInQueue(ar)) == NULL) - break; + ar = ReleaseAvatarRequestInQueue(ar); continue; } m_avatarsMutex->Leave(); @@ -596,6 +595,7 @@ int CIcqProto::GetAvatarData(MCONTACT hContact, DWORD dwUin, const char *szUid, requestAvatarConnection(); return 0; } + ar = ar->pNext; } // add request to queue, processed after successful login -- cgit v1.2.3