aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2022-10-01 15:58:27 +0300
committerlevlam <levlam@telegram.org>2022-10-01 15:58:27 +0300
commitbe87e4179f9ce80fe4352eec0a0a9937d420284a (patch)
tree095ecad4caea3926c02b509558b75e2fc7399f22
parent39d2ac80b0212102ecf4f9421d68c0060aff42e0 (diff)
Inline ActorOwn::hangup.
-rw-r--r--td/telegram/net/NetQueryDispatcher.cpp12
-rw-r--r--tdactor/td/actor/impl/ActorId-decl.h1
-rw-r--r--tdactor/td/actor/impl/ActorId.h7
3 files changed, 7 insertions, 13 deletions
diff --git a/td/telegram/net/NetQueryDispatcher.cpp b/td/telegram/net/NetQueryDispatcher.cpp
index 41492d555..385203983 100644
--- a/td/telegram/net/NetQueryDispatcher.cpp
+++ b/td/telegram/net/NetQueryDispatcher.cpp
@@ -209,12 +209,12 @@ void NetQueryDispatcher::stop() {
std::lock_guard<std::mutex> guard(main_dc_id_mutex_);
td_guard_.reset();
stop_flag_ = true;
- delayer_.hangup();
- for (const auto &dc : dcs_) {
- dc.main_session_.hangup();
- dc.upload_session_.hangup();
- dc.download_session_.hangup();
- dc.download_small_session_.hangup();
+ delayer_.reset();
+ for (auto &dc : dcs_) {
+ dc.main_session_.reset();
+ dc.upload_session_.reset();
+ dc.download_session_.reset();
+ dc.download_small_session_.reset();
}
public_rsa_key_watchdog_.reset();
dc_auth_manager_.reset();
diff --git a/tdactor/td/actor/impl/ActorId-decl.h b/tdactor/td/actor/impl/ActorId-decl.h
index 03db2775b..9fc7f6b98 100644
--- a/tdactor/td/actor/impl/ActorId-decl.h
+++ b/tdactor/td/actor/impl/ActorId-decl.h
@@ -90,7 +90,6 @@ class ActorOwn {
ActorId<ActorType> get() const;
ActorId<ActorType> release();
void reset(ActorId<ActorType> other = ActorId<ActorType>());
- void hangup() const;
ActorType *get_actor_unsafe() const;
private:
diff --git a/tdactor/td/actor/impl/ActorId.h b/tdactor/td/actor/impl/ActorId.h
index fa93118e2..30cbbfb91 100644
--- a/tdactor/td/actor/impl/ActorId.h
+++ b/tdactor/td/actor/impl/ActorId.h
@@ -88,15 +88,10 @@ ActorId<ActorType> ActorOwn<ActorType>::release() {
template <class ActorType>
void ActorOwn<ActorType>::reset(ActorId<ActorType> other) {
static_assert(sizeof(ActorType) > 0, "Can't use ActorOwn with incomplete type");
- hangup();
- id_ = std::move(other);
-}
-
-template <class ActorType>
-void ActorOwn<ActorType>::hangup() const {
if (!id_.empty()) {
send_event(id_, Event::hangup());
}
+ id_ = std::move(other);
}
template <class ActorType>