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;