Fix crash in session destruction.

This commit is contained in:
John Preston 2020-06-22 13:06:40 +04:00
parent 1705a1aa4a
commit bc3719038f
1 changed files with 3 additions and 2 deletions

View File

@ -253,6 +253,9 @@ Session::Session(not_null<Main::Session*> session)
}
void Session::clear() {
// Optimization: clear notifications before destroying items.
Core::App().notifications().clearFromSession(_session);
_sendActions.clear();
_histories->unloadAll();
@ -1120,8 +1123,6 @@ void Session::setupUserIsContactViewer() {
}
Session::~Session() {
// Optimization: clear notifications before destroying items.
Core::App().notifications().clearFromSession(_session);
clearLocalStorage();
}