Beta version 5.5.7: Workaround MSVC bug.

This commit is contained in:
John Preston 2024-10-01 10:55:42 +04:00
parent b518f7c4c4
commit 1cb92ef69a

View file

@ -318,6 +318,8 @@ HistoryWidget::HistoryWidget(
) | rpl::start_with_next(crl::guard(_list, [=] { ) | rpl::start_with_next(crl::guard(_list, [=] {
_list->onParentGeometryChanged(); _list->onParentGeometryChanged();
}), lifetime()); }), lifetime());
const auto weak = Ui::MakeWeak(this);
_scroll->addContentRequests( _scroll->addContentRequests(
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
if (_history && _history->loadedAtBottom()) { if (_history && _history->loadedAtBottom()) {
@ -332,7 +334,7 @@ HistoryWidget::HistoryWidget(
if (tryToAppend() == Result::MediaLoading) { if (tryToAppend() == Result::MediaLoading) {
const auto sharedLifetime = std::make_shared<rpl::lifetime>(); const auto sharedLifetime = std::make_shared<rpl::lifetime>();
session().downloaderTaskFinished( session().downloaderTaskFinished(
) | rpl::start_with_next([=, weak = Ui::MakeWeak(this)] { ) | rpl::start_with_next([=] {
if (const auto strong = weak.data()) { if (const auto strong = weak.data()) {
if (tryToAppend() != Result::MediaLoading) { if (tryToAppend() != Result::MediaLoading) {
sharedLifetime->destroy(); sharedLifetime->destroy();