diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 95edbaa8b1..5716349d6c 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -253,6 +253,9 @@ Session::Session(not_null 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(); }