1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

HackStudio: Stop debugger when opening new project

Moved code to stop the debugger in the HackStudioWidget destructor to
a new method so that this can be called in both the destructor and when
opening a new project.
This commit is contained in:
Lennon Donaghy 2021-08-02 01:11:42 +01:00 committed by Andreas Kling
parent 971a5a70d1
commit ff2a1ee8b0
2 changed files with 8 additions and 1 deletions

View file

@ -201,6 +201,7 @@ void HackStudioWidget::open_project(const String& root_path)
add_new_editor(*m_editors_splitter);
m_todo_entries_widget->clear();
m_terminal_wrapper->clear_including_history();
stop_debugger_if_running();
}
m_project = Project::open_with_root_path(root_path);
VERIFY(m_project);
@ -1153,7 +1154,7 @@ void HackStudioWidget::handle_external_file_deletion(const String& filepath)
close_file_in_all_editors(filepath);
}
HackStudioWidget::~HackStudioWidget()
void HackStudioWidget::stop_debugger_if_running()
{
if (!m_debugger_thread.is_null()) {
Debugger::the().stop();
@ -1166,6 +1167,11 @@ HackStudioWidget::~HackStudioWidget()
}
}
HackStudioWidget::~HackStudioWidget()
{
stop_debugger_if_running();
}
HackStudioWidget::ContinueDecision HackStudioWidget::warn_unsaved_changes(const String& prompt)
{
if (!any_document_is_dirty())