summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-12-09 17:08:22 +0000
committerRobert Pösel <robyer@seznam.cz>2014-12-09 17:08:22 +0000
commit89ce406fb710ff91a3f80d5f1ee674c09a1f7603 (patch)
tree647d9eb265828c67fcda51afa62bcfc1d747544b /protocols
parent4813e22b08398091946738cd324d73455f9b5b43 (diff)
Steam: Add lock to SetStatus (attempt to fix some freeze/crash)
git-svn-id: http://svn.miranda-ng.org/main/trunk@11302 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Steam/src/steam_proto.cpp4
-rw-r--r--protocols/Steam/src/steam_proto.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index 1cd0193702..2cb802c9fd 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -9,6 +9,7 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) :
CreateProtoService(PS_CREATEACCMGRUI, &CSteamProto::OnAccountManagerInit);
InitializeCriticalSection(&this->contact_search_lock);
+ InitializeCriticalSection(&this->set_status_lock);
InitQueue();
@@ -69,6 +70,7 @@ CSteamProto::~CSteamProto()
UninitQueue();
DeleteCriticalSection(&this->contact_search_lock);
+ DeleteCriticalSection(&this->set_status_lock);
}
MCONTACT __cdecl CSteamProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
@@ -350,6 +352,8 @@ int __cdecl CSteamProto::SetApparentMode(MCONTACT hContact, int mode) { return 0
int CSteamProto::SetStatus(int new_status)
{
+ mir_cslock lock(set_status_lock);
+
// Routing statuses not supported by Steam
switch (new_status)
{
diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h
index 47fe830eef..d3c5b65b0a 100644
--- a/protocols/Steam/src/steam_proto.h
+++ b/protocols/Steam/src/steam_proto.h
@@ -153,6 +153,7 @@ protected:
ULONG hMessageProcess;
CRITICAL_SECTION contact_search_lock;
CRITICAL_SECTION requests_queue_lock;
+ CRITICAL_SECTION set_status_lock;
LIST<QueueItem> requestsQueue;
// instances