From f9be304e542d62a3d36878fec151899e4afa5b38 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 24 Aug 2020 16:57:36 +0400 Subject: [PATCH] Fix crash in logout from passcoded screen. --- Telegram/SourceFiles/mainwindow.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index 3bafea1cd0..39aca78a1a 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -283,12 +283,13 @@ void MainWindow::setupIntro(Intro::EnterPoint point) { void MainWindow::setupMain() { Expects(account().sessionExists()); - const auto animated = (_intro || _passcodeLock); + const auto animated = _intro + || (_passcodeLock && !Core::App().passcodeLocked()); const auto bg = animated ? grabInner() : QPixmap(); - const auto weak = (_main && _layer) + const auto weakAnimatedLayer = (_main && _layer && !_passcodeLock) ? Ui::MakeWeak(_layer.get()) : nullptr; - if (weak) { + if (weakAnimatedLayer) { Assert(!animated); _layer->hideAllAnimatedPrepare(); } else { @@ -310,7 +311,7 @@ void MainWindow::setupMain() { Core::App().checkStartUrl(); } fixOrder(); - if (const auto strong = weak.data()) { + if (const auto strong = weakAnimatedLayer.data()) { strong->hideAllAnimatedRun(); } }