test: Free clipboard data after calling SDL_GetClipboardText()
Clipboard allocations were being leaked in two instances.
This commit is contained in:
parent
486af58797
commit
f4aca6866c
1 changed files with 2 additions and 0 deletions
|
@ -168,6 +168,7 @@ static int clipboard_testClipboardDataFunctions(void *arg)
|
||||||
text && SDL_strcmp(text, expected_text) == 0,
|
text && SDL_strcmp(text, expected_text) == 0,
|
||||||
"Verify clipboard text, expected \"%s\", got \"%s\"",
|
"Verify clipboard text, expected \"%s\", got \"%s\"",
|
||||||
expected_text, text);
|
expected_text, text);
|
||||||
|
SDL_free(text);
|
||||||
|
|
||||||
boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT]);
|
boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT]);
|
||||||
SDLTest_AssertCheck(
|
SDLTest_AssertCheck(
|
||||||
|
@ -269,6 +270,7 @@ static int clipboard_testClipboardDataFunctions(void *arg)
|
||||||
text && SDL_strcmp(text, expected_text) == 0,
|
text && SDL_strcmp(text, expected_text) == 0,
|
||||||
"Verify clipboard text, expected \"%s\", got \"%s\"",
|
"Verify clipboard text, expected \"%s\", got \"%s\"",
|
||||||
expected_text, text);
|
expected_text, text);
|
||||||
|
SDL_free(text);
|
||||||
|
|
||||||
boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT]);
|
boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT]);
|
||||||
SDLTest_AssertCheck(
|
SDLTest_AssertCheck(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue