mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Fix possible crash in non-cancelled request.
This commit is contained in:
parent
49bc8ccd6a
commit
c480ab1a3b
1 changed files with 4 additions and 5 deletions
|
@ -123,6 +123,7 @@ void GroupCall::requestParticipants() {
|
|||
return;
|
||||
}
|
||||
}
|
||||
api().request(base::take(_participantsRequestId)).cancel();
|
||||
_participantsRequestId = api().request(MTPphone_GetGroupParticipants(
|
||||
input(),
|
||||
MTP_vector<MTPInputPeer>(), // ids
|
||||
|
@ -132,8 +133,8 @@ void GroupCall::requestParticipants() {
|
|||
: _nextOffset),
|
||||
MTP_int(kRequestPerPage)
|
||||
)).done([=](const MTPphone_GroupParticipants &result) {
|
||||
_participantsRequestId = 0;
|
||||
result.match([&](const MTPDphone_groupParticipants &data) {
|
||||
_participantsRequestId = 0;
|
||||
const auto reloaded = processSavedFullCall();
|
||||
_nextOffset = qs(data.vnext_offset());
|
||||
_peer->owner().processUsers(data.vusers());
|
||||
|
@ -168,7 +169,7 @@ bool GroupCall::processSavedFullCall() {
|
|||
if (!_savedFull) {
|
||||
return false;
|
||||
}
|
||||
_reloadRequestId = 0;
|
||||
api().request(base::take(_reloadRequestId)).cancel();
|
||||
_reloadLastFinished = crl::now();
|
||||
processFullCallFields(*base::take(_savedFull));
|
||||
return true;
|
||||
|
@ -511,10 +512,8 @@ void GroupCall::reloadIfStale() {
|
|||
void GroupCall::reload() {
|
||||
if (_reloadRequestId || _applyingQueuedUpdates) {
|
||||
return;
|
||||
} else if (_participantsRequestId) {
|
||||
api().request(_participantsRequestId).cancel();
|
||||
_participantsRequestId = 0;
|
||||
}
|
||||
api().request(base::take(_participantsRequestId)).cancel();
|
||||
|
||||
DEBUG_LOG(("Group Call Participants: "
|
||||
"Reloading with queued: %1"
|
||||
|
|
Loading…
Add table
Reference in a new issue