Date: Sun, 28 Mar 2004 16:38:32 +1200
authorSam Lantinga <slouken@libsdl.org>
Sun, 16 May 2004 17:40:32 +0000
changeset 88807def9d03315
parent 887 b4b64bb88f2f
child 889 eac8c69b5706
Date: Sun, 28 Mar 2004 16:38:32 +1200
From: Paul Eggleton
Subject: [SDL] Possible memory leak in SDL 1.2.7

Taking a look at this function X11_CreateWMCursor and its companion
X11_FreeWMCursor (in src/video/x11/SDL_x11mouse.c), I can see that
X11_CreateWMCursor is making several calls to XCreatePixmap, but there are no
corresponding calls in X11_FreeWMCursor to XFreePixmap.
src/video/x11/SDL_x11mouse.c
     1.1 --- a/src/video/x11/SDL_x11mouse.c	Sun May 16 17:19:48 2004 +0000
     1.2 +++ b/src/video/x11/SDL_x11mouse.c	Sun May 16 17:40:32 2004 +0000
     1.3 @@ -142,6 +142,8 @@
     1.4  	/* Create the cursor */
     1.5  	cursor->x_cursor = XCreatePixmapCursor(SDL_Display, data_pixmap,
     1.6  				mask_pixmap, &black, &white, hot_x, hot_y);
     1.7 +	XFreePixmap(SDL_Display, data_pixmap);
     1.8 +	XFreePixmap(SDL_Display, mask_pixmap);
     1.9  
    1.10  	/* Release the event thread */
    1.11  	XSync(SDL_Display, False);