Fix possible crash in ListWidget destructor.

This commit is contained in:
John Preston 2025-01-04 21:59:48 +04:00
parent 603aa5db5f
commit aa445adfff

View file

@ -4277,6 +4277,11 @@ void ListWidget::overrideIsChatWide(bool isWide) {
ListWidget::~ListWidget() {
// Destroy child widgets first, because they may invoke leaveEvent-s.
_emptyInfo = nullptr;
if (const auto raw = _menu.release()) {
crl::on_main(raw, [=] {
delete raw;
});
}
}
void ConfirmDeleteSelectedItems(not_null<ListWidget*> widget) {