From 3490704d648641fdc5832294dd0b8293f75d9c25 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Thu, 18 Jul 2024 14:23:22 +0200 Subject: [PATCH] fix sdl new string policies --- src/chat_gui4.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/chat_gui4.cpp b/src/chat_gui4.cpp index 8a448cc..6563ab7 100644 --- a/src/chat_gui4.cpp +++ b/src/chat_gui4.cpp @@ -753,10 +753,9 @@ float ChatGui4::render(float time_delta) { if (!ImGui::IsItemFocused()) { ImGui::SetKeyboardFocusHere(-1); } - char* primary_text = SDL_GetPrimarySelectionText(); + const char* primary_text = SDL_GetPrimarySelectionText(); if (primary_text != nullptr) { ImGui::GetIO().AddInputCharactersUTF8(primary_text); - SDL_free(primary_text); } } }