Fixed bug 2086 - valgrind memory not released
authorSam Lantinga <slouken@libsdl.org>
Thu, 17 Apr 2014 20:06:02 -0700
changeset 8707d838991b3fb0
parent 8706 0c9660fdf9bf
child 8708 2a76a78f7723
Fixed bug 2086 - valgrind memory not released

Sylvain

Someone provided a patch for this, recently on the mailing list :
-----

Hi,

it is possible to skip the bug in libX11 by using the defaults for
XNResourceName and XNResourceClass in `XCreateIC' (the table for the
"Input Context Values" [1] in libX11-doc shows that a default is
provided if it is not set).

diff -ur SDL2-2.0.3~/src/video/x11/SDL_x11window.c SDL2-2.0.3/src/video/x11/SDL_x11window.c
--- SDL2-2.0.3~/src/video/x11/SDL_x11window.c 2014-04-04 17:09:40.764307181 +0200
+++ SDL2-2.0.3/src/video/x11/SDL_x11window.c 2014-04-04 17:10:23.887765046 +0200
@@ -239,8 +239,7 @@
data->ic =
X11_XCreateIC(videodata->im, XNClientWindow, w, XNFocusWindow, w,
XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
- XNResourceName, videodata->classname, XNResourceClass,
- videodata->classname, NULL);
+ NULL);
}
#endif
data->created = created;


Tito Latini

[1] http://www.x.org/releases/X11R7.7-RC1/doc/libX11/libX11/libX11.html#Input_Context_Values
src/video/x11/SDL_x11window.c
     1.1 --- a/src/video/x11/SDL_x11window.c	Thu Apr 17 20:02:11 2014 -0700
     1.2 +++ b/src/video/x11/SDL_x11window.c	Thu Apr 17 20:06:02 2014 -0700
     1.3 @@ -239,8 +239,7 @@
     1.4          data->ic =
     1.5              X11_XCreateIC(videodata->im, XNClientWindow, w, XNFocusWindow, w,
     1.6                         XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
     1.7 -                       XNResourceName, videodata->classname, XNResourceClass,
     1.8 -                       videodata->classname, NULL);
     1.9 +                       NULL);
    1.10      }
    1.11  #endif
    1.12      data->created = created;