Remove TdCallback::on_closed

GitOrigin-RevId: e08d6c10e4147c39f2d6f5ea795f92875644f1a7
This commit is contained in:
Arseny Smirnov 2018-09-14 19:58:13 +03:00
parent 03a11bc2ec
commit da118270bd
5 changed files with 3 additions and 10 deletions

View File

@ -163,7 +163,7 @@ class Client::Impl final {
void on_error(std::uint64_t id, td_api::object_ptr<td_api::error> error) override {
output_queue_->writer_put({id, std::move(error)});
}
void on_closed() override {
~Callback() {
Scheduler::instance()->finish();
}

View File

@ -3713,7 +3713,6 @@ void Td::on_closed() {
close_flag_ = 5;
send_update(
td_api::make_object<td_api::updateAuthorizationState>(td_api::make_object<td_api::authorizationStateClosed>()));
callback_->on_closed();
dec_stop_cnt();
}

View File

@ -33,12 +33,6 @@ class TdCallback {
*/
virtual void on_error(std::uint64_t id, td_api::object_ptr<td_api::error> error) = 0;
/**
* This function is called when TDLib has been fully closed. It's not possible to make any new requests after this function has been called
* without creating a new instance of ClientActor. The callback will be destroyed as soon as a call to this function returns.
*/
virtual void on_closed() = 0;
/**
* Destroys the TdCallback.
*/

View File

@ -673,7 +673,7 @@ class CliClient final : public Actor {
void on_error(uint64 id, tl_object_ptr<td_api::error> error) override {
client_->on_error(id, std::move(error));
}
void on_closed() override {
~TdCallbackImpl() {
client_->on_closed();
}

View File

@ -81,7 +81,7 @@ class TestClient : public Actor {
void on_error(uint64 id, tl_object_ptr<td_api::error> error) override {
send_closure(client_, &TestClient::on_error, id, std::move(error));
}
void on_closed() override {
~TdCallbackImpl() {
send_closure(client_, &TestClient::on_closed);
}