Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update imgui_impl_sdl3.cpp #7801

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions backends/imgui_impl_sdl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct ImGui_ImplSDL3_Data
SDL_Window* Window;
SDL_Renderer* Renderer;
Uint64 Time;
char* ClipboardTextData;
const char* ClipboardTextData;

// IME handling
SDL_Window* ImeWindow;
Expand Down Expand Up @@ -114,7 +114,7 @@ static const char* ImGui_ImplSDL3_GetClipboardText(void*)
{
ImGui_ImplSDL3_Data* bd = ImGui_ImplSDL3_GetBackendData();
if (bd->ClipboardTextData)
SDL_free(bd->ClipboardTextData);
SDL_free((void*)bd->ClipboardTextData);
bd->ClipboardTextData = SDL_GetClipboardText();
return bd->ClipboardTextData;
}
Expand Down Expand Up @@ -507,7 +507,7 @@ void ImGui_ImplSDL3_Shutdown()
ImGuiIO& io = ImGui::GetIO();

if (bd->ClipboardTextData)
SDL_free(bd->ClipboardTextData);
SDL_free((void*)bd->ClipboardTextData);
for (ImGuiMouseCursor cursor_n = 0; cursor_n < ImGuiMouseCursor_COUNT; cursor_n++)
SDL_DestroyCursor(bd->MouseCursors[cursor_n]);
ImGui_ImplSDL3_CloseGamepads();
Expand Down