From 5df94ff719eccd04c7450df35fb5e3f2b36e2ee7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 13 Jul 2014 10:50:59 +0000 Subject: wrapping the most evident critical sections into a class git-svn-id: http://svn.miranda-ng.org/main/trunk@9785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/IRCG/src/ircproto.cpp | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'protocols/IRCG/src/ircproto.cpp') diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index a212afdfdb..8b036c14c8 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -32,15 +32,13 @@ static int CompareSessions(const CDccSession* p1, const CDccSession* p2) } CIrcProto::CIrcProto(const char* szModuleName, const TCHAR* tszUserName) : -PROTO(szModuleName, tszUserName), -m_dcc_chats(10, CompareSessions), -m_dcc_xfers(10, CompareSessions), -m_ignoreItems(10), -vUserhostReasons(10), -vWhoInProgress(10) -{ - InitializeCriticalSection(&cs); - InitializeCriticalSection(&m_gchook); + PROTO(szModuleName, tszUserName), + m_dcc_chats(10, CompareSessions), + m_dcc_xfers(10, CompareSessions), + m_ignoreItems(10), + vUserhostReasons(10), + vWhoInProgress(10) +{ m_evWndCreate = ::CreateEvent(NULL, FALSE, FALSE, NULL); CreateProtoService(PS_GETMYAWAYMSG, &CIrcProto::GetMyAwayMsg); @@ -67,8 +65,6 @@ vWhoInProgress(10) CreateProtoService("/GetIrcData", &CIrcProto::Scripting_GetIrcData); codepage = CP_ACP; - InitializeCriticalSection(&m_resolve); - InitializeCriticalSection(&m_dcc); InitPrefs(); @@ -152,17 +148,12 @@ CIrcProto::~CIrcProto() Netlib_CloseHandle(m_hNetlibUser); m_hNetlibUser = NULL; Netlib_CloseHandle(hNetlibDCC); hNetlibDCC = NULL; - DeleteCriticalSection(&cs); - DeleteCriticalSection(&m_gchook); - if (hMenuRoot) CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM)hMenuRoot, 0); mir_free(m_alias); CloseHandle(m_evWndCreate); - DeleteCriticalSection(&m_resolve); - DeleteCriticalSection(&m_dcc); KillChatTimer(OnlineNotifTimer); KillChatTimer(OnlineNotifTimer3); } -- cgit v1.2.3