[Scummvm-git-logs] scummvm master -> 6234b93813a0c2f1a04d7cc294ad9c194d4e229f

bgK bastien.bouclet at gmail.com
Tue Sep 13 09:23:37 CEST 2016


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9e502bf9aa SDL: Plug a memory leak in OSystem_SDL::getTextFromClipboard
6234b93813 SDL: Add a fixme regarding the encoding of the string returned by getTextFromClipboard


Commit: 9e502bf9aad760416f5529344f3781824db731cd
    https://github.com/scummvm/scummvm/commit/9e502bf9aad760416f5529344f3781824db731cd
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-09-13T09:19:53+02:00

Commit Message:
SDL: Plug a memory leak in OSystem_SDL::getTextFromClipboard

Changed paths:
    backends/platform/sdl/sdl.cpp



diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 18f2a49..a175c53 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -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


Commit: 6234b93813a0c2f1a04d7cc294ad9c194d4e229f
    https://github.com/scummvm/scummvm/commit/6234b93813a0c2f1a04d7cc294ad9c194d4e229f
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-09-13T09:21:51+02:00

Commit Message:
SDL: Add a fixme regarding the encoding of the string returned by getTextFromClipboard

Changed paths:
    backends/platform/sdl/sdl.cpp



diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index a175c53..74c40ad 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -479,6 +479,9 @@ Common::String OSystem_SDL::getTextFromClipboard() {
 	char *text = SDL_GetClipboardText();
 	Common::String strText = text;
 	SDL_free(text);
+
+	// FIXME: The string returned by SDL is in UTF-8, it is not clear
+	// what encoding should be used for the returned string.
 	return strText;
 #else
 	return "";





More information about the Scummvm-git-logs mailing list