sdl2.pc.in
author Sam Lantinga <slouken@libsdl.org>
Thu, 17 Apr 2014 20:02:11 -0700
changeset 8706 0c9660fdf9bf
parent 7876 d6373384b5ce
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.
     1 # sdl pkg-config source file
     2 
     3 prefix=@prefix@
     4 exec_prefix=@exec_prefix@
     5 libdir=@libdir@
     6 includedir=@includedir@
     7 
     8 Name: sdl2
     9 Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
    10 Version: @SDL_VERSION@
    11 Requires:
    12 Conflicts:
    13 Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@
    14 Libs.private: @SDL_STATIC_LIBS@
    15 Cflags: -I${includedir}/SDL2 @SDL_CFLAGS@