From 48889ce56efb796dc91bbbea210355bee0e6bdbe Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 10 Nov 2018 12:06:44 +0400 Subject: [PATCH] Better fix for a crash on quit. --- Telegram/SourceFiles/info/info_layer_widget.cpp | 4 +++- Telegram/SourceFiles/mainwindow.cpp | 1 - Telegram/SourceFiles/window/layer_widget.cpp | 9 ++------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Telegram/SourceFiles/info/info_layer_widget.cpp b/Telegram/SourceFiles/info/info_layer_widget.cpp index 49e0c74f9..c5aea6f2b 100644 --- a/Telegram/SourceFiles/info/info_layer_widget.cpp +++ b/Telegram/SourceFiles/info/info_layer_widget.cpp @@ -265,7 +265,9 @@ void LayerWidget::closeHook() { } LayerWidget::~LayerWidget() { - restoreFloatPlayerDelegate(); + if (!App::quitting()) { + restoreFloatPlayerDelegate(); + } } } // namespace Info diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index 5d7154765..b1efaba00 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -904,7 +904,6 @@ 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 6cf87ab4f..66fa140bf 100644 --- a/Telegram/SourceFiles/window/layer_widget.cpp +++ b/Telegram/SourceFiles/window/layer_widget.cpp @@ -400,16 +400,11 @@ void LayerStackWidget::hideLayers(anim::type animated) { } void LayerStackWidget::hideAll(anim::type animated) { - const auto clear = [=] { + startAnimation([] {}, [=] { clearLayers(); clearSpecialLayer(); _mainMenu.destroyDelayed(); - }; - if (App::quitting()) { - clear(); - } else { - startAnimation([] {}, clear, Action::HideAll, animated); - } + }, Action::HideAll, animated); } void LayerStackWidget::hideTopLayer(anim::type animated) {