summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--protocols/Telegram/src/proto.h2
-rw-r--r--protocols/Telegram/src/server.cpp7
2 files changed, 6 insertions, 3 deletions
diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h
index 29cc8b3654..1cf276323e 100644
--- a/protocols/Telegram/src/proto.h
+++ b/protocols/Telegram/src/proto.h
@@ -216,7 +216,7 @@ class CTelegramProto : public PROTO<CTelegramProto>
OBJLIST<TG_OWN_MESSAGE> m_arOwnMsg;
mir_cs m_csRequests;
- OBJLIST<TG_REQUEST_BASE> m_arRequests;
+ LIST<TG_REQUEST_BASE> m_arRequests;
mir_cs m_csFiles;
LIST<TG_FILE_REQUEST> m_arFiles;
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index fdec9f3046..e3f82dcd5b 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -194,11 +194,14 @@ void CTelegramProto::ProcessResponse(td::ClientManager::Response response)
if (response.request_id) {
TG_REQUEST tmp(response.request_id, 0);
- mir_cslock lck(m_csRequests);
+ mir_cslockfull lck(m_csRequests);
auto *p = m_arRequests.find(&tmp);
if (p) {
- p->Execute(this, response);
m_arRequests.remove(p);
+ lck.unlock();
+
+ p->Execute(this, response);
+ delete p;
}
return;
}