From 1ab4dbe46613b1de50f59031833041a2e0c3a8e9 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 6 Apr 2019 12:12:24 +0400 Subject: [PATCH] Fix crash in application closing. --- Telegram/SourceFiles/core/sandbox.cpp | 9 +++++---- Telegram/SourceFiles/ui/effects/animations.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index f1e20438a..6b8fd9cfa 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -121,10 +121,11 @@ int Sandbox::start() { [=] { newInstanceConnected(); }); crl::on_main(this, [=] { checkForQuit(); }); - connect( - this, - &QCoreApplication::aboutToQuit, - [=] { closeApplication(); }); + connect(this, &QCoreApplication::aboutToQuit, [=] { + customEnterFromEventLoop([&] { + closeApplication(); + }); + }); if (cManyInstance()) { LOG(("Many instance allowed, starting...")); diff --git a/Telegram/SourceFiles/ui/effects/animations.cpp b/Telegram/SourceFiles/ui/effects/animations.cpp index d41c1a15e..1f1c83697 100644 --- a/Telegram/SourceFiles/ui/effects/animations.cpp +++ b/Telegram/SourceFiles/ui/effects/animations.cpp @@ -128,7 +128,7 @@ void Manager::schedule() { stopTimer(); _scheduled = true; - Ui::PostponeCall([=] { + Ui::PostponeCall(static_cast(this), [=] { _scheduled = false; if (_forceImmediateUpdate) { _forceImmediateUpdate = false;