From 4532e59933d0275106d09cd8dcc9f6bd1bb0ada0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 10 Nov 2018 10:10:32 +0400 Subject: [PATCH] Beta version 1.4.6: Fix crash on quit. --- Telegram/SourceFiles/mainwindow.cpp | 1 + Telegram/SourceFiles/window/layer_widget.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index b1efaba00..5d7154765 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -904,6 +904,7 @@ void MainWindow::updateIsActiveHook() { } MainWindow::~MainWindow() { + ui_hideSettingsAndLayer(anim::type::instant); if (_clearManager) { _clearManager->stop(); _clearManager = nullptr; diff --git a/Telegram/SourceFiles/window/layer_widget.cpp b/Telegram/SourceFiles/window/layer_widget.cpp index 77850d454..6cf87ab4f 100644 --- a/Telegram/SourceFiles/window/layer_widget.cpp +++ b/Telegram/SourceFiles/window/layer_widget.cpp @@ -400,11 +400,16 @@ void LayerStackWidget::hideLayers(anim::type animated) { } void LayerStackWidget::hideAll(anim::type animated) { - startAnimation([] {}, [this] { + const auto clear = [=] { clearLayers(); clearSpecialLayer(); _mainMenu.destroyDelayed(); - }, Action::HideAll, animated); + }; + if (App::quitting()) { + clear(); + } else { + startAnimation([] {}, clear, Action::HideAll, animated); + } } void LayerStackWidget::hideTopLayer(anim::type animated) {