From b67762a7f3d2d63f71de3a2d82fb627581b8b3da Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Thu, 22 Dec 2022 12:58:10 +0100 Subject: [PATCH] HackStudio: Make a new ProjectBuilder object when opening a project We couldn't compile a project after creating it, because the project builder was still holding a reference to the previous freed project. Fixes: #15715 --- Userland/DevTools/HackStudio/HackStudioWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/DevTools/HackStudio/HackStudioWidget.cpp b/Userland/DevTools/HackStudio/HackStudioWidget.cpp index 9177f3e4e3..132f41231a 100644 --- a/Userland/DevTools/HackStudio/HackStudioWidget.cpp +++ b/Userland/DevTools/HackStudio/HackStudioWidget.cpp @@ -185,7 +185,6 @@ ErrorOr> HackStudioWidget::create(DeprecatedStri }; } - widget->m_project_builder = make(*widget->m_terminal_wrapper, *widget->m_project); widget->project().model().set_should_show_dotfiles(Config::read_bool("HackStudio"sv, "Global"sv, "ShowDotfiles"sv, false)); return widget; @@ -252,6 +251,7 @@ void HackStudioWidget::open_project(DeprecatedString const& root_path) } m_project = Project::open_with_root_path(root_path); VERIFY(m_project); + m_project_builder = make(*m_terminal_wrapper, *m_project); if (m_project_tree_view) { m_project_tree_view->set_model(m_project->model()); m_project_tree_view->update();