README-SDL.txt
author Sam Lantinga <slouken@libsdl.org>
Thu, 17 Apr 2014 20:02:11 -0700
changeset 8706 0c9660fdf9bf
parent 7222 2435b221d77d
child 9507 b1e690e9c5b3
permissions -rw-r--r--
Fixed bug 2502 - Memory leak inside SDL_x11events.c -> X11_DispatchEvent(_THIS)

bojko_1000

Code @566:
if (data->xwindow) {
Atom _net_frame_extents = X11_XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
Atom type = None;
int format;
unsigned long nitems = 0, bytes_after;
unsigned char *property;
X11_XGetWindowProperty(display, data->xwindow,
_net_frame_extents, 0, 16, 0,
XA_CARDINAL, &type, &format,
&nitems, &bytes_after, &property);

if (type != None && nitems == 4)
{
border_left = ((long*)property)[0];
border_right = ((long*)property)[1];
border_top = ((long*)property)[2];
border_bottom = ((long*)property)[3];
}
}

Code after _the fix_:
if (data->xwindow) {
Atom _net_frame_extents = X11_XInternAtom(display, "_NET_FRAME_EXTENTS", 0);
Atom type = None;
int format;
unsigned long nitems = 0, bytes_after;
unsigned char *property;
X11_XGetWindowProperty(display, data->xwindow,
_net_frame_extents, 0, 16, 0,
XA_CARDINAL, &type, &format,
&nitems, &bytes_after, &property);

if (type != None && nitems == 4)
{
border_left = ((long*)property)[0];
border_right = ((long*)property)[1];
border_top = ((long*)property)[2];
border_bottom = ((long*)property)[3];
}
X11_XFree(property);
}

I have found that leak with valgrind.
slouken@7222
     1
slouken@7222
     2
Please distribute this file with the SDL runtime environment:
slouken@7222
     3
slouken@7222
     4
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
slouken@7222
     5
designed to make it easy to write multi-media software, such as games and
slouken@7222
     6
emulators.
slouken@7222
     7
slouken@7222
     8
The Simple DirectMedia Layer library source code is available from:
slouken@7222
     9
http://www.libsdl.org/
slouken@7222
    10
slouken@7222
    11
This library is distributed under the terms of the zlib license:
slouken@7222
    12
http://www.zlib.net/zlib_license.html
slouken@7222
    13