diff options
author | George Hazan <ghazan@miranda.im> | 2019-07-08 12:56:48 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-07-08 12:56:48 +0300 |
commit | ee05a4f6a032ca925608a6f1265c969eeff73191 (patch) | |
tree | 1397d98722cca5aae91ffb01eef0fb1707e79f4a /protocols/Tox | |
parent | 4587283773e8d942a0aee38b5937219a845a78a0 (diff) |
fixes #1999 ([Tox] A stuck file transfer causes crash on miranda exit)
Diffstat (limited to 'protocols/Tox')
-rw-r--r-- | protocols/Tox/src/tox_transfer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp index d3d26ddf72..f1939c2475 100644 --- a/protocols/Tox/src/tox_transfer.cpp +++ b/protocols/Tox/src/tox_transfer.cpp @@ -350,9 +350,11 @@ int CToxProto::CancelTransfer(MCONTACT, HANDLE hTransfer) {
FileTransferParam *transfer = (FileTransferParam*)hTransfer;
debugLogA(__FUNCTION__": transfer (%d) is canceled", transfer->fileNumber);
- tox_file_control(m_tox, transfer->friendNumber, transfer->fileNumber, TOX_FILE_CONTROL_CANCEL, nullptr);
- transfers.Remove(transfer);
+ if (IsOnline())
+ tox_file_control(m_tox, transfer->friendNumber, transfer->fileNumber, TOX_FILE_CONTROL_CANCEL, nullptr);
+
+ transfers.Remove(transfer);
return 0;
}
|