mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-07-27 10:56:23 +00:00
test: Fix memory leak in testclipboard
This commit is contained in:
@@ -130,7 +130,11 @@ static float PrintClipboardText(float x, float y, const char *mime_type)
|
||||
static float PrintPrimarySelectionText(float x, float y)
|
||||
{
|
||||
if (SDL_HasPrimarySelectionText()) {
|
||||
SDL_RenderDebugText(renderer, x, y, SDL_GetPrimarySelectionText());
|
||||
char *text = SDL_GetPrimarySelectionText();
|
||||
if (text) {
|
||||
SDL_RenderDebugText(renderer, x, y, text);
|
||||
SDL_free(text);
|
||||
}
|
||||
return SDL_DEBUG_TEXT_FONT_CHARACTER_SIZE + 2.0f;
|
||||
}
|
||||
return 0.0f;
|
||||
|
||||
Reference in New Issue
Block a user