From 6b38b94db4aedd32c5e0c6868669853e36959262 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 20 Oct 2020 21:20:56 +0300 Subject: [PATCH] Don't capture 'this' in SendFilesBox::Block. --- Telegram/SourceFiles/boxes/send_files_box.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/boxes/send_files_box.cpp b/Telegram/SourceFiles/boxes/send_files_box.cpp index 4695078f8..3da6299bd 100644 --- a/Telegram/SourceFiles/boxes/send_files_box.cpp +++ b/Telegram/SourceFiles/boxes/send_files_box.cpp @@ -157,15 +157,16 @@ rpl::producer SendFilesBox::Block::itemDeleteRequest() const { using namespace rpl::mappers; const auto preview = _preview.get(); + const auto from = _from; if (_isAlbum) { const auto album = static_cast(_preview.get()); - return album->thumbDeleted() | rpl::map(_1 + _from); + return album->thumbDeleted() | rpl::map(_1 + from); } else if (_isSingleMedia) { const auto media = static_cast(preview); - return media->deleteRequests() | rpl::map([=] { return _from; }); + return media->deleteRequests() | rpl::map([from] { return from; }); } else { const auto single = static_cast(preview); - return single->deleteRequests() | rpl::map([=] { return _from; }); + return single->deleteRequests() | rpl::map([from] { return from; }); } } @@ -173,15 +174,16 @@ rpl::producer SendFilesBox::Block::itemReplaceRequest() const { using namespace rpl::mappers; const auto preview = _preview.get(); + const auto from = _from; if (_isAlbum) { const auto album = static_cast(preview); - return album->thumbChanged() | rpl::map(_1 + _from); + return album->thumbChanged() | rpl::map(_1 + from); } else if (_isSingleMedia) { const auto media = static_cast(preview); - return media->editRequests() | rpl::map([=] { return _from; }); + return media->editRequests() | rpl::map([from] { return from; }); } else { const auto single = static_cast(preview); - return single->editRequests() | rpl::map([=] { return _from; }); + return single->editRequests() | rpl::map([from] { return from; }); } }