mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +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:
parent
971a5a70d1
commit
ff2a1ee8b0
2 changed files with 8 additions and 1 deletions
|
@ -201,6 +201,7 @@ void HackStudioWidget::open_project(const String& root_path)
|
||||||
add_new_editor(*m_editors_splitter);
|
add_new_editor(*m_editors_splitter);
|
||||||
m_todo_entries_widget->clear();
|
m_todo_entries_widget->clear();
|
||||||
m_terminal_wrapper->clear_including_history();
|
m_terminal_wrapper->clear_including_history();
|
||||||
|
stop_debugger_if_running();
|
||||||
}
|
}
|
||||||
m_project = Project::open_with_root_path(root_path);
|
m_project = Project::open_with_root_path(root_path);
|
||||||
VERIFY(m_project);
|
VERIFY(m_project);
|
||||||
|
@ -1153,7 +1154,7 @@ void HackStudioWidget::handle_external_file_deletion(const String& filepath)
|
||||||
close_file_in_all_editors(filepath);
|
close_file_in_all_editors(filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
HackStudioWidget::~HackStudioWidget()
|
void HackStudioWidget::stop_debugger_if_running()
|
||||||
{
|
{
|
||||||
if (!m_debugger_thread.is_null()) {
|
if (!m_debugger_thread.is_null()) {
|
||||||
Debugger::the().stop();
|
Debugger::the().stop();
|
||||||
|
@ -1166,6 +1167,11 @@ HackStudioWidget::~HackStudioWidget()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HackStudioWidget::~HackStudioWidget()
|
||||||
|
{
|
||||||
|
stop_debugger_if_running();
|
||||||
|
}
|
||||||
|
|
||||||
HackStudioWidget::ContinueDecision HackStudioWidget::warn_unsaved_changes(const String& prompt)
|
HackStudioWidget::ContinueDecision HackStudioWidget::warn_unsaved_changes(const String& prompt)
|
||||||
{
|
{
|
||||||
if (!any_document_is_dirty())
|
if (!any_document_is_dirty())
|
||||||
|
|
|
@ -103,6 +103,7 @@ private:
|
||||||
void update_statusbar();
|
void update_statusbar();
|
||||||
|
|
||||||
void handle_external_file_deletion(const String& filepath);
|
void handle_external_file_deletion(const String& filepath);
|
||||||
|
void stop_debugger_if_running();
|
||||||
|
|
||||||
void create_open_files_view(GUI::Widget& parent);
|
void create_open_files_view(GUI::Widget& parent);
|
||||||
void create_toolbar(GUI::Widget& parent);
|
void create_toolbar(GUI::Widget& parent);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue