Replaced vector container for SendFilesBox::Block with deque.

SendFilesBox::Block (aka Block) passes action
callbacks to AlbumPreview / SingleMediaPreview.
These callbacks access Block::_items through a captured "this" pointer.

With std::vector<Block>, _blocks.emplace_back() may reallocate and
move existing Block objects. Callbacks already stored inside previews
then keep a dangling Block*, and a later context-menu action can crash
when reading this->_items.

Switched _blocks to std::deque<Block> so existing element addresses stay
stable on std::deque::push_back, keeping callback captures valid
for previews.
This commit is contained in:
23rd
2026-02-27 19:26:12 +03:00
committed by John Preston
parent 3ebec4db75
commit 04dbbab4a1
+1 -1
View File
@@ -307,7 +307,7 @@ private:
object_ptr<Ui::ScrollArea> _scroll;
QPointer<Ui::VerticalLayout> _inner;
std::vector<Block> _blocks;
std::deque<Block> _blocks;
Fn<void()> _whenReadySend;
bool _preparing = false;