SDL: Plug a memory leak in OSystem_SDL::getTextFromClipboard
This commit is contained in:
parent
10fd5046c2
commit
9e502bf9aa
1 changed files with 3 additions and 2 deletions
|
@ -477,8 +477,9 @@ Common::String OSystem_SDL::getTextFromClipboard() {
|
||||||
|
|
||||||
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
#if SDL_VERSION_ATLEAST(2, 0, 0)
|
||||||
char *text = SDL_GetClipboardText();
|
char *text = SDL_GetClipboardText();
|
||||||
if (text == nullptr) return "";
|
Common::String strText = text;
|
||||||
return text;
|
SDL_free(text);
|
||||||
|
return strText;
|
||||||
#else
|
#else
|
||||||
return "";
|
return "";
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue