diff --git a/src/app/commands/cmd_export_sprite_sheet.cpp b/src/app/commands/cmd_export_sprite_sheet.cpp index 04e48534a..55383d7da 100644 --- a/src/app/commands/cmd_export_sprite_sheet.cpp +++ b/src/app/commands/cmd_export_sprite_sheet.cpp @@ -870,9 +870,12 @@ private: if (!preview()->isSelected()) { if (m_spriteSheet) { - DocDestroyer destroyer(UIContext::instance(), m_spriteSheet.release(), 100); + auto ctx = UIContext::instance(); + DocDestroyer destroyer(ctx, m_spriteSheet.release(), 100); destroyer.destroyDocument(); m_editor = nullptr; + + ctx->setActiveDocument(m_site.document()); } return; }