summaryrefslogtreecommitdiff
path: root/plugins/HistoryStats
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-04-30 09:31:17 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-04-30 09:31:17 +0000
commit329f87401432b166f47ae076a58d12029863649c (patch)
treed8a9aef7dce8125bd966e2e4dae568c8d3166274 /plugins/HistoryStats
parent5e43bcf443914472db988b8e1dd84aedf70a7037 (diff)
minus critical section
git-svn-id: http://svn.miranda-ng.org/main/trunk@13286 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HistoryStats')
-rw-r--r--plugins/HistoryStats/src/utils.cpp8
-rw-r--r--plugins/HistoryStats/src/utils.h2
2 files changed, 2 insertions, 8 deletions
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();