From 1c2ab6cfda4eb3acf2e89ddc92c177fc8ed8f7b1 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 1 Nov 2010 18:16:40 +0200 Subject: fixes --- utilities.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index e73d920..d3938a6 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -400,9 +400,9 @@ void CleanProtocolTmpThread(std::string proto) std::list::iterator end = contacts.end(); for(std::list::iterator i = contacts.begin(); i != end; ++i) { - CallService(MS_DB_CONTACT_DELETE, (WPARAM)*i, 0); LogSpamToFile(*i, _T("Deleted")); HistoryLogFunc(*i, "Deleted"); + CallService(MS_DB_CONTACT_DELETE, (WPARAM)*i, 0); } clean_mutex.unlock(); } @@ -428,9 +428,9 @@ void CleanProtocolExclThread(std::string proto) std::list::iterator end = contacts.end(); for(std::list::iterator i = contacts.begin(); i != end; ++i) { - CallService(MS_DB_CONTACT_DELETE, (WPARAM)*i, 0); LogSpamToFile(*i, _T("Deleted")); HistoryLogFunc(*i, "Deleted"); + CallService(MS_DB_CONTACT_DELETE, (WPARAM)*i, 0); } clean_mutex.unlock(); } @@ -472,6 +472,8 @@ void HistoryLogFunc(HANDLE hContact, std::string message) { if(gbHistoryLog) { + if(hContact == INVALID_HANDLE_VALUE) + return; std::string msg = message; msg.append("\n"); msg.append("Protocol: ").append((char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0)).append(" Contact:"); -- cgit v1.2.3