From 76489a78858a4a024a0c60cab129674c12c33664 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 1 Sep 2017 20:52:37 +0300 Subject: [PATCH] Fix stack overflow in passcode lock check. A regression was introduced in e209737b1a. We call MainWindow::doWeReadMentions() in the history paintEvent, that calls Auth().checkAutoLock() and may start passcode locking. Passcode locking starts animation and grabs the window content, calling history paintEvent() which leads to deadlock. Now we call Auth().checkAutoLock() asyncronously. --- Telegram/SourceFiles/mainwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 8c83cd394..bcb621c6d 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -4406,7 +4406,7 @@ MainWidget::~MainWidget() { void MainWidget::updateOnline(bool gotOtherOffline) { if (this != App::main()) return; - Auth().checkAutoLock(); + InvokeQueued(this, [] { Auth().checkAutoLock(); }); bool isOnline = App::wnd()->isActive(); int updateIn = Global::OnlineUpdatePeriod();