From 1cb92ef69ac97621e170a4a25037d6393718000a Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 1 Oct 2024 10:55:42 +0400 Subject: [PATCH] Beta version 5.5.7: Workaround MSVC bug. --- Telegram/SourceFiles/history/history_widget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 88f2083497aee5..e8f531b50a9dc3 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -318,6 +318,8 @@ HistoryWidget::HistoryWidget( ) | rpl::start_with_next(crl::guard(_list, [=] { _list->onParentGeometryChanged(); }), lifetime()); + + const auto weak = Ui::MakeWeak(this); _scroll->addContentRequests( ) | rpl::start_with_next([=] { if (_history && _history->loadedAtBottom()) { @@ -332,7 +334,7 @@ HistoryWidget::HistoryWidget( if (tryToAppend() == Result::MediaLoading) { const auto sharedLifetime = std::make_shared(); session().downloaderTaskFinished( - ) | rpl::start_with_next([=, weak = Ui::MakeWeak(this)] { + ) | rpl::start_with_next([=] { if (const auto strong = weak.data()) { if (tryToAppend() != Result::MediaLoading) { sharedLifetime->destroy();