diff options
author | George Hazan <ghazan@miranda.im> | 2020-04-22 19:50:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-04-22 19:50:35 +0300 |
commit | 87a87064b905976602168c729e4bff4a54932223 (patch) | |
tree | f3c28c0c4582e1fa1435ee01d8adb0ab2333c259 | |
parent | 971beea1813007a0cb71127ff739be665d9854e4 (diff) |
fixes #2336 (Jabber: падение при попытке отменить висящий файлтрансфер)
-rw-r--r-- | protocols/JabberG/src/jabber_ft.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index df8a0cee03..9f7b49985b 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -84,6 +84,15 @@ static void __cdecl FakeAckThread(void *param) delete ft;
}
+static void __cdecl FailedAckThread(void *param)
+{
+ Sleep(100);
+
+ auto *ft = (filetransfer *)param;
+ ft->ppro->ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft);
+ delete ft;
+}
+
void CJabberProto::FtInitiate(filetransfer *ft)
{
if (ft == nullptr)
@@ -92,9 +101,8 @@ void CJabberProto::FtInitiate(filetransfer *ft) if (!m_bJabberOnline) {
debugLogA("Protocol is offline, file transfer failed");
-LBL_Error:
- ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, ft);
- delete ft;
+ LBL_Error:
+ mir_forkthread(FailedAckThread, ft);
return;
}
|