From 329f87401432b166f47ae076a58d12029863649c Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 30 Apr 2015 09:31:17 +0000 Subject: minus critical section git-svn-id: http://svn.miranda-ng.org/main/trunk@13286 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryStats/src/utils.cpp | 8 +------- plugins/HistoryStats/src/utils.h | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/HistoryStats/src/utils.cpp b/plugins/HistoryStats/src/utils.cpp index 5b6a781784..c00fb7a43c 100644 --- a/plugins/HistoryStats/src/utils.cpp +++ b/plugins/HistoryStats/src/utils.cpp @@ -1001,13 +1001,11 @@ void RTFFilter::init() m_Data.m_hRTFConv = NULL; } - InitializeCriticalSection(&m_Data.m_RTFConvCS); } void RTFFilter::uninit() { if (m_Data.m_hRTFConv) { - DeleteCriticalSection(&m_Data.m_RTFConvCS); FreeLibrary(m_Data.m_hRTFConv); m_Data.m_hRTFConv = NULL; @@ -1018,7 +1016,7 @@ void RTFFilter::uninit() ext::t::string RTFFilter::filter(const ext::t::string& str) { // protect, because library is not thread-safe - EnterCriticalSection(&m_Data.m_RTFConvCS); + mir_cslock lck(m_Data.m_RTFConvCS); #if defined(_UNICODE) const ext::a::string strA = utils::toA(str); @@ -1036,7 +1034,6 @@ ext::t::string RTFFilter::filter(const ext::t::string& str) if (len == -1) { // someting went wrong, maybe it's not a real RTF string - LeaveCriticalSection(&m_Data.m_RTFConvCS); return str; } @@ -1054,15 +1051,12 @@ ext::t::string RTFFilter::filter(const ext::t::string& str) // someting went wrong, maybe it's not a real RTF string delete[] out_buf; - LeaveCriticalSection(&m_Data.m_RTFConvCS); return str; } ext::t::string out_str(out_buf, res / sizeof(TCHAR)-1); delete[] out_buf; - LeaveCriticalSection(&m_Data.m_RTFConvCS); - return out_str; } diff --git a/plugins/HistoryStats/src/utils.h b/plugins/HistoryStats/src/utils.h index 7112389d37..8c2160dee6 100644 --- a/plugins/HistoryStats/src/utils.h +++ b/plugins/HistoryStats/src/utils.h @@ -161,7 +161,7 @@ private: private: HMODULE m_hRTFConv; RTFCONVSTRING m_RTFConvString; - CRITICAL_SECTION m_RTFConvCS; + mir_cs m_RTFConvCS; private: explicit RTFFilter(); -- cgit v1.2.3