Skip to content

Commit

Permalink
Fix possible crash in ListWidget destructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Jan 4, 2025
1 parent 603aa5d commit aa445ad
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit aa445ad

Please sign in to comment.