Fix possible crash in ListWidget destructor.

This commit is contained in:
John Preston 2022-01-26 10:29:15 +03:00
parent 59ed41abfe
commit 2e94488eb4

View file

@ -3181,7 +3181,10 @@ void ListWidget::setEmptyInfoWidget(base::unique_qptr<Ui::RpWidget> &&w) {
_emptyInfo = std::move(w); _emptyInfo = std::move(w);
} }
ListWidget::~ListWidget() = default; ListWidget::~ListWidget() {
// Destroy child widgets first, because they may invoke leaveEvent-s.
_emptyInfo = nullptr;
}
void ConfirmDeleteSelectedItems(not_null<ListWidget*> widget) { void ConfirmDeleteSelectedItems(not_null<ListWidget*> widget) {
const auto items = widget->getSelectedItems(); const auto items = widget->getSelectedItems();