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.
This commit is contained in:
John Preston 2017-09-01 20:52:37 +03:00
parent df64c972d8
commit 76489a7885
1 changed files with 1 additions and 1 deletions

View File

@ -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();