From 004a60ded550500d54cf4a63777a6dff889a714f Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 6 Apr 2023 16:51:57 +0400 Subject: [PATCH] Fix a possible crash in folder link export. --- Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp b/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp index 7d43dc9b6..6e88d3757 100644 --- a/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp +++ b/Telegram/SourceFiles/boxes/filters/edit_filter_box.cpp @@ -777,12 +777,13 @@ void EditFilterBox( data->force_assign(updated); const auto id = updated.id(); state->links = owner->chatsFilters().chatlistLinks(id); - ExportFilterLink(id, shared, [=](Data::ChatFilterLink link) { + ExportFilterLink(id, shared, crl::guard(box, [=]( + Data::ChatFilterLink link) { Expects(link.id == id); *data = data->current().withChatlist(true, true); window->show(ShowLinkBox(window, updated, link)); - }, [=](QString error) { + }), crl::guard(box, [=](QString error) { const auto session = &window->session(); if (error == u"CHATLISTS_TOO_MUCH"_q) { window->show(Box(ShareableFiltersLimitBox, session)); @@ -796,7 +797,7 @@ void EditFilterBox( } else { window->show(ShowLinkBox(window, updated, { .id = id })); } - }); + })); })); }, createLink->lifetime()); AddSkip(content);