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)
|
||||
char *text = SDL_GetClipboardText();
|
||||
if (text == nullptr) return "";
|
||||
return text;
|
||||
Common::String strText = text;
|
||||
SDL_free(text);
|
||||
return strText;
|
||||
#else
|
||||
return "";
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue