mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user