summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_proto.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-07-09 10:33:09 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-07-09 10:33:09 +0000
commit21c6c7a7cb65e25d55cce54b6e097c797b66f95e (patch)
tree0c8485de41cf9c550d8e7ed930bf8ba9f6b0b3e4 /protocols/VKontakte/src/vk_proto.cpp
parent3f42d3319d2a3e404db524428300ab0a8a9540b2 (diff)
VKontakte:
add locks for timer and vk_Instances fix mark messages as read in multiaccaunt configuration fix duplicate events and news version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@14514 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index efa6adfc2d..7ea79a813a 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -30,6 +30,7 @@ static int sttCompareAsyncHttpRequest(const AsyncHttpRequest *p1, const AsyncHtt
}
LIST<CVkProto> vk_Instances(1, sttCompareProtocols);
+mir_cs csInstances;
static COLORREF sttColors[] = { 0, 1, 2, 3, 4, 5, 6 };
CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
@@ -125,7 +126,10 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
// Set all contacts offline -- in case we crashed
SetAllContactStatuses(ID_STATUS_OFFLINE);
- vk_Instances.insert(this);
+ {
+ mir_cslock lck(csInstances);
+ vk_Instances.insert(this);
+ }
}
CVkProto::~CVkProto()
@@ -139,7 +143,10 @@ CVkProto::~CVkProto()
Popup_UnregisterClass(m_hPopupClassError);
if (m_hPopupClassNotification)
Popup_UnregisterClass(m_hPopupClassNotification);
- vk_Instances.remove(this);
+ {
+ mir_cslock lck(csInstances);
+ vk_Instances.remove(this);
+ }
}
int CVkProto::OnModulesLoaded(WPARAM, LPARAM)