Fixed possible crash on deleting messages.

This commit is contained in:
23rd 2021-01-22 19:31:34 +03:00
parent c21125f9f2
commit 4895e5e110
1 changed files with 4 additions and 1 deletions

View File

@ -860,9 +860,12 @@ void DeleteMessagesBox::deleteAndClear() {
_deleteConfirmedCallback();
}
// deleteMessages can initiate closing of the current section,
// which will cause this box to be destroyed.
const auto session = _session;
_session->data().histories().deleteMessages(_ids, revoke);
const auto session = _session;
Ui::hideLayer();
session->data().sendHistoryChangeNotifications();
}