diff --git a/Telegram/SourceFiles/auth_session.cpp b/Telegram/SourceFiles/auth_session.cpp index 12807e32d..69059bd5d 100644 --- a/Telegram/SourceFiles/auth_session.cpp +++ b/Telegram/SourceFiles/auth_session.cpp @@ -274,8 +274,8 @@ AuthSession::AuthSession(UserId userId) , _uploader(std::make_unique()) , _storage(std::make_unique()) , _notifications(std::make_unique(this)) -, _changelogs(Core::Changelogs::Create(this)) -, _data(std::make_unique(this)) { +, _data(std::make_unique(this)) +, _changelogs(Core::Changelogs::Create(this)) { Expects(_userId != 0); _saveDataTimer.setCallback([this] { diff --git a/Telegram/SourceFiles/auth_session.h b/Telegram/SourceFiles/auth_session.h index 69ad94c88..033ae9195 100644 --- a/Telegram/SourceFiles/auth_session.h +++ b/Telegram/SourceFiles/auth_session.h @@ -258,11 +258,13 @@ private: const std::unique_ptr _uploader; const std::unique_ptr _storage; const std::unique_ptr _notifications; - const std::unique_ptr _changelogs; // _data depends on _downloader / _uploader, including destructor. const std::unique_ptr _data; + // _changelogs depends on _data, subscribes on chats loading event. + const std::unique_ptr _changelogs; + rpl::lifetime _lifetime; };