From c1067d8fe1e06bfe6fed2644a97cc90150f2f862 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 24 Jun 2021 09:08:57 +0300 Subject: [PATCH] Fixed possible crash in notifications manager. --- Telegram/SourceFiles/window/notifications_manager_default.cpp | 2 +- Telegram/SourceFiles/window/notifications_manager_default.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index 93a9efee4..e042cd5e4 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -76,7 +76,7 @@ Manager::Manager(System *system) system->settingsChanged( ) | rpl::start_with_next([=](ChangeType change) { settingsChanged(change); - }, system->lifetime()); + }, _lifetime); } Manager::QueuedNotification::QueuedNotification( diff --git a/Telegram/SourceFiles/window/notifications_manager_default.h b/Telegram/SourceFiles/window/notifications_manager_default.h index 8a3fa7e54..b92b4e393 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.h +++ b/Telegram/SourceFiles/window/notifications_manager_default.h @@ -126,6 +126,8 @@ private: mutable QPixmap _hiddenUserpicPlaceholder; + rpl::lifetime _lifetime; + }; namespace internal {