From 2b8e76a060c7a70e56f3ff91d76b9197751237b1 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 2 May 2019 10:59:15 +0300 Subject: [PATCH] Replaced Auth.lifetime() in buttons with internal lifetime. --- Telegram/SourceFiles/platform/mac/touchbar.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/platform/mac/touchbar.mm b/Telegram/SourceFiles/platform/mac/touchbar.mm index 5fbfd358b4..5b0b77cda4 100644 --- a/Telegram/SourceFiles/platform/mac/touchbar.mm +++ b/Telegram/SourceFiles/platform/mac/touchbar.mm @@ -71,6 +71,8 @@ NSImage *qt_mac_create_nsimage(const QPixmap &pm); @implementation PinnedDialogButton : NSCustomTouchBarItem +auto lifetime = rpl::lifetime(); + - (id) init:(int)num { if (num == kSavedMessagesId) { return [self initSavedMessages]; @@ -104,7 +106,7 @@ NSImage *qt_mac_create_nsimage(const QPixmap &pm); ) | rpl::start_with_next([=] { self.waiting = true; updateImage(); - }, Auth().lifetime()); + }, lifetime); base::ObservableViewer( Auth().downloaderTaskFinished() @@ -112,7 +114,7 @@ NSImage *qt_mac_create_nsimage(const QPixmap &pm); if (self.waiting) { updateImage(); } - }, Auth().lifetime()); + }, lifetime); return self; }