Clear logcat entries when (re)starting logcat

This commit is contained in:
blankie 2023-02-07 13:36:51 +07:00
parent bda12e0112
commit c43dd3a4db
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
2 changed files with 5 additions and 0 deletions

View File

@ -302,6 +302,7 @@ bool LogcatThread::_handle_start_request() {
}
};
// TODO what if *this->_logcat_command was mutated during copying?
std::string logcat_command = *this->_logcat_command;
if (logcat_command.empty()) {
logcat_command = default_logcat_command;

View File

@ -100,6 +100,8 @@ void main_window(bool latest_log_entries_read, ImFont* monospace_font, LogcatThr
}
if (ImGui::Button("Start", !logcat_running)) {
logcat_entries.clear();
filtered_logcat_entry_offsets.clear();
logcat_thread.logcat_process_request.store(LogcatProcessRequest::Start);
}
ImGui::SameLine();
@ -108,6 +110,8 @@ void main_window(bool latest_log_entries_read, ImFont* monospace_font, LogcatThr
}
ImGui::SameLine();
if (ImGui::Button("Restart", logcat_running)) {
logcat_entries.clear();
filtered_logcat_entry_offsets.clear();
logcat_thread.logcat_process_request.store(LogcatProcessRequest::Start);
}