diff --git a/td/telegram/SequenceDispatcher.cpp b/td/telegram/SequenceDispatcher.cpp index 21d3233be..09bb0d375 100644 --- a/td/telegram/SequenceDispatcher.cpp +++ b/td/telegram/SequenceDispatcher.cpp @@ -77,7 +77,7 @@ void SequenceDispatcher::try_resend_query(Data &data, NetQueryPtr query) { // TODO: if query is ok, use NetQueryCallback::on_result if (data.callback_.empty()) { do_finish(data); - send_closure(G()->td(), &Td::on_result, std::move(query)); + send_closure_later(G()->td(), &Td::on_result, std::move(query)); loop(); return; } @@ -385,7 +385,7 @@ class MultiSequenceDispatcherImpl final : public MultiSequenceDispatcher { if (node.callback.empty()) { auto query = std::move(node.net_query); scheduler_.finish_task(task_id); - send_closure(G()->td(), &Td::on_result, std::move(query)); + send_closure_later(G()->td(), &Td::on_result, std::move(query)); loop(); return; } diff --git a/td/telegram/net/NetQueryDispatcher.cpp b/td/telegram/net/NetQueryDispatcher.cpp index 385203983..d57c5c3ba 100644 --- a/td/telegram/net/NetQueryDispatcher.cpp +++ b/td/telegram/net/NetQueryDispatcher.cpp @@ -60,7 +60,7 @@ void NetQueryDispatcher::dispatch(NetQueryPtr net_query) { if (!net_query->in_sequence_dispatcher() && !net_query->get_chain_ids().empty()) { net_query->debug("sent to main sequence dispatcher"); - send_closure(sequence_dispatcher_, &MultiSequenceDispatcher::send, std::move(net_query)); + send_closure_later(sequence_dispatcher_, &MultiSequenceDispatcher::send, std::move(net_query)); return; } @@ -73,7 +73,7 @@ void NetQueryDispatcher::dispatch(NetQueryPtr net_query) { net_query->resend(); } else if (code < 0 || code == 500 || code == 420) { net_query->debug("sent to NetQueryDelayer"); - return send_closure(delayer_, &NetQueryDelayer::delay, std::move(net_query)); + return send_closure_later(delayer_, &NetQueryDelayer::delay, std::move(net_query)); } } }