From 6af9ac29ecb75d811f24e91c1fba5ecbb6a341f6 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 3 Sep 2024 19:13:45 +0200 Subject: [PATCH] Backends: SDL3: following SDL3 reverting their change, result of SDL_GetDisplays() must be freed. (#7809) Reverts 271910e --- backends/imgui_impl_sdl3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backends/imgui_impl_sdl3.cpp b/backends/imgui_impl_sdl3.cpp index 4f42a8fcd..498c1fb59 100644 --- a/backends/imgui_impl_sdl3.cpp +++ b/backends/imgui_impl_sdl3.cpp @@ -818,7 +818,7 @@ static void ImGui_ImplSDL3_UpdateMonitors() bd->WantUpdateMonitors = false; int display_count; - const SDL_DisplayID* displays = SDL_GetDisplays(&display_count); + SDL_DisplayID* displays = SDL_GetDisplays(&display_count); for (int n = 0; n < display_count; n++) { // Warning: the validity of monitor DPI information on Windows depends on the application DPI awareness settings, which generally needs to be set in the manifest or at runtime. @@ -839,6 +839,7 @@ static void ImGui_ImplSDL3_UpdateMonitors() continue; // Some accessibility applications are declaring virtual monitors with a DPI of 0, see #7902. platform_io.Monitors.push_back(monitor); } + SDL_free(displays); } void ImGui_ImplSDL3_NewFrame()