Fix crash in session destruction.

This commit is contained in:
John Preston 2020-06-22 13:06:40 +04:00
parent 1705a1aa4a
commit bc3719038f

View file

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