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:
parent
7e6aec6687
commit
b38c32a573
|
@ -1085,7 +1085,7 @@ display_windows(void)
|
||||||
window->destroy(window);
|
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::SetNextWindowPos(window->position, ImGuiCond_FirstUseEver);
|
||||||
ImGui::SetNextWindowSize(window->size, ImGuiCond_FirstUseEver);
|
ImGui::SetNextWindowSize(window->size, ImGuiCond_FirstUseEver);
|
||||||
if (ImGui::Begin(window->name, &window->opened)) {
|
if (ImGui::Begin(window->name, &window->opened)) {
|
||||||
|
|
Loading…
Reference in New Issue