+
+ /* Keep the list of internal windows up-to-date. */
+ for (int win_type = SRC_WIN; (win_type < MAX_MAJOR_WINDOWS); win_type++)
+ if (tui_win_list[win_type] != nullptr
+ && !tui_win_list[win_type]->is_visible ())
+ tui_win_list[win_type] = nullptr;
+
+ /* This should always be made visible by a layout. */
+ gdb_assert (TUI_CMD_WIN->is_visible ());
+
+ /* Now delete any window that was not re-applied. */
+ tui_win_info *focus = tui_win_with_focus ();
+ for (tui_win_info *win_info : saved_windows)
+ {
+ if (!win_info->is_visible ())
+ {
+ if (focus == win_info)
+ tui_set_win_focus_to (tui_windows[0]);
+ delete win_info;
+ }
+ }
+
+ if (gdbarch == nullptr && TUI_DISASM_WIN != nullptr)
+ tui_get_begin_asm_address (&gdbarch, &addr);
+ tui_update_source_windows_with_addr (gdbarch, addr);