From 1b7022e8ffbfbd531fee91e9ac862239b31ccc2c Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 27 Apr 2019 01:21:08 +0300 Subject: [PATCH] Add Td explicit destructor. GitOrigin-RevId: aa7d2ee90a43bc0cf1bb003c7fb48735fcaf6a82 --- SplitSource.php | 4 ++-- td/telegram/Td.cpp | 2 ++ td/telegram/Td.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SplitSource.php b/SplitSource.php index 8dc937ca..c22a9b01 100644 --- a/SplitSource.php +++ b/SplitSource.php @@ -260,7 +260,7 @@ function split_file($file, $chunks, $undo) { if (strpos($cpp_name, 'Td.cpp') === false) { // destructor Td::~Td needs to see definitions of all forward-declared classes $td_methods = array( 'auth_manager[_(-][^.]|AuthManager' => 'AuthManager', - 'ConfigShared|shared_config[(][)]' => 'ConfigShared', + 'ConfigShared|shared_config[(]' => 'ConfigShared', 'contacts_manager[_(-][^.]|ContactsManager([^ ;.]| [^*])' => 'ContactsManager', 'file_reference_manager[_(-][^.]|FileReferenceManager|file_references[)]' => 'FileReferenceManager', 'file_manager[_(-][^.]|FileManager([^ ;.]| [^*])|update_file[)]' => 'files/FileManager', @@ -307,7 +307,7 @@ $files = array('td/telegram/ContactsManager' => 20, 'td/telegram/MessagesManager' => 50, 'td/telegram/NotificationManager' => 10, 'td/telegram/StickersManager' => 10, - 'td/telegram/Td' => 80, + 'td/telegram/Td' => 50, 'td/generate/auto/td/telegram/td_api' => 10, 'td/generate/auto/td/telegram/td_api_json' => 10, 'td/generate/auto/td/telegram/telegram_api' => 10); diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 369e4694..84804767 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -3011,6 +3011,8 @@ class GetInviteTextRequest : public RequestActor { Td::Td(unique_ptr callback) : callback_(std::move(callback)) { } +Td::~Td() = default; + void Td::on_alarm_timeout_callback(void *td_ptr, int64 alarm_id) { auto td = static_cast(td_ptr); auto td_id = td->actor_id(td); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index a094241f..193fbd1a 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -90,6 +90,7 @@ class Td final : public NetQueryCallback { Td(Td &&) = delete; Td &operator=(const Td &) = delete; Td &operator=(Td &&) = delete; + ~Td() override; explicit Td(unique_ptr callback);