From 09e40319f76be13078ddba7566572b0e0adb93fe Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 13 Aug 2018 21:33:59 -0300 Subject: [PATCH] Fix crash when Aseprite is being closed --- src/app/ui_context.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/ui_context.cpp b/src/app/ui_context.cpp index 067fd51bf..0dc966ebc 100644 --- a/src/app/ui_context.cpp +++ b/src/app/ui_context.cpp @@ -78,6 +78,12 @@ void UIContext::setActiveView(DocView* docView) { MainWindow* mainWin = App::instance()->mainWindow(); + // This can happen when the main window is being destroyed when we + // close the app, and the active view is changing because we are + // closing down every single tab. + if (!mainWin) + return; + // Prioritize workspace for user input. App::instance()->inputChain().prioritize(mainWin->getWorkspace(), nullptr);