From bc670c87fb8b24668155deabc75c5b536f165e38 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Mon, 27 Oct 2014 11:05:53 +0000 Subject: VKontakte: more accurate clear history git-svn-id: http://svn.miranda-ng.org/main/trunk@10879 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_thread.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index d55b9be3db..6e66c0c0c2 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -1145,8 +1145,12 @@ INT_PTR __cdecl CVkProto::SvcGetAllServerHistory(WPARAM hContact, LPARAM) setByte(hContact, "ImportHistory", 1); setDword(hContact, "lastmsgid", 0); - while (HANDLE hd = db_event_first(hContact)) - db_event_delete(hContact, hd); + HANDLE hDBEvent = db_event_first(hContact); + while (hDBEvent) { + HANDLE hDBEventNext = db_event_next(hContact, hDBEvent); + db_event_delete(hContact, hDBEvent); + hDBEvent = hDBEventNext; + } debugLogA("CVkProto::SvcGetAllServerHistory"); GetHistoryDlgMessages(hContact, 0, INT_MAX, -1); -- cgit v1.2.3