intel/aub_viewer: fix access to freed memory

Windows closed while we're displaying them might lead to invalid
memory accessed, so use the safe iterators on the list of windows.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4430>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4430>
This commit is contained in:
Lionel Landwerlin 2019-07-17 14:42:49 +03:00
parent 7e6aec6687
commit b38c32a573
1 changed files with 1 additions and 1 deletions

View File

@ -1085,7 +1085,7 @@ display_windows(void)
window->destroy(window);
}
list_for_each_entry(struct window, window, &context.windows, link) {
list_for_each_entry_safe(struct window, window, &context.windows, link) {
ImGui::SetNextWindowPos(window->position, ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(window->size, ImGuiCond_FirstUseEver);
if (ImGui::Begin(window->name, &window->opened)) {