From 23cd50d29e1f697e113ae27c7af2ae318d528479 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 21 Jun 2025 14:11:34 -0500 Subject: [PATCH] [studio] Fix Studio to clear editor pointers when opening a new project --- release-notes.md | 1 + src/olympic/studio/applib/src/studioui.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/release-notes.md b/release-notes.md index da505853..b0f8ebd5 100644 --- a/release-notes.md +++ b/release-notes.md @@ -5,6 +5,7 @@ * Fix file deletion to close file even if not active * Fix file copy to work when creating a copy with the name of a previously deleted file +* Fix crash that could occur after switching projects * Make file picker popup accept on double click of a file * TileSheetEditor: Fix copy/cut/paste enablement when there is no selection * TileSheetEditor: Fix manual redo of draw actions, fix drawing to pixel 0, 0 diff --git a/src/olympic/studio/applib/src/studioui.cpp b/src/olympic/studio/applib/src/studioui.cpp index 51acc240..99babadf 100644 --- a/src/olympic/studio/applib/src/studioui.cpp +++ b/src/olympic/studio/applib/src/studioui.cpp @@ -649,6 +649,9 @@ ox::Error StudioUI::openProjectPath(ox::StringParam path) noexcept { ox::make_unique_catch(keelCtx(m_tctx), std::move(path), m_projectDataDir) .moveTo(m_project)); m_sctx.project = m_project.get(); + m_activeEditor = nullptr; + m_activeEditorOnLastDraw = nullptr; + m_activeEditorUpdatePending = nullptr; turbine::setWindowTitle( m_tctx, ox::sfmt("{} - {}", keelCtx(m_tctx).appName, m_project->projectPath())); m_deleteConfirmation.deleteFile.connect(m_sctx.project, &Project::deleteItem);