fix sdl primary clipboard text leak
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / dumpsyms (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled

This commit is contained in:
Green Sky 2025-03-29 21:21:08 +01:00
parent 98e55e20ce
commit a1024c8fde
No known key found for this signature in database
GPG Key ID: DBE05085D874AB4A

View File

@ -525,9 +525,10 @@ float ChatGui4::render(float time_delta, bool window_hidden, bool window_focused
if (!ImGui::IsItemFocused()) {
ImGui::SetKeyboardFocusHere(-1);
}
const char* primary_text = SDL_GetPrimarySelectionText();
char* primary_text = SDL_GetPrimarySelectionText();
if (primary_text != nullptr) {
ImGui::GetIO().AddInputCharactersUTF8(primary_text);
SDL_free(primary_text);
}
}
}