mirror of
https://github.com/raysan5/raylib.git
synced 2026-07-31 04:38:54 +00:00
[rcore][desktop] Fix clipboard image memory leak (#5968)
* [rcore][desktop] Fix clipboard image memory leak * [delete] delete comment GetClipboardImage into NOTE about where put SDL_free() .
This commit is contained in:
@@ -1255,12 +1255,14 @@ Image GetClipboardImage(void)
|
||||
|
||||
for (int i = 0; i < SDL_arraysize(imageFormats); i++)
|
||||
{
|
||||
// NOTE: This pointer should be free with SDL_free() at some point
|
||||
fileData = SDL_GetClipboardData(imageFormats[i], &dataSize);
|
||||
|
||||
if (fileData)
|
||||
{
|
||||
image = LoadImageFromMemory(imageExtensions[i], fileData, (int)dataSize);
|
||||
|
||||
SDL_free(fileData);
|
||||
|
||||
if (IsImageValid(image))
|
||||
{
|
||||
TRACELOG(LOG_INFO, "Clipboard: Got image from clipboard successfully: %s", imageExtensions[i]);
|
||||
|
||||
Reference in New Issue
Block a user