Closing minor memory leak in XME code. SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Sun, 29 Oct 2006 02:46:42 +0000
branchSDL-1.2
changeset 3885a10bddfdc40f
parent 3884 dba874934f0c
child 3886 36f155ec8133
Closing minor memory leak in XME code.
src/video/Xext/XME/xme.c
src/video/Xext/extensions/xme.h
src/video/x11/SDL_x11video.c
     1.1 --- a/src/video/Xext/XME/xme.c	Fri Oct 27 20:18:24 2006 +0000
     1.2 +++ b/src/video/Xext/XME/xme.c	Sun Oct 29 02:46:42 2006 +0000
     1.3 @@ -393,3 +393,13 @@
     1.4    return (rep.success ? xTrue : xFalse);
     1.5  }
     1.6  
     1.7 +
     1.8 +/* SDL addition from Ryan: free memory used by xme. */
     1.9 +void XiGMiscDestroy(void)
    1.10 +{
    1.11 +    if (xigmisc_info) {
    1.12 +        XextDestroyExtension(xigmisc_info);
    1.13 +        xigmisc_info = NULL;
    1.14 +    }
    1.15 +}
    1.16 +
     2.1 --- a/src/video/Xext/extensions/xme.h	Fri Oct 27 20:18:24 2006 +0000
     2.2 +++ b/src/video/Xext/extensions/xme.h	Sun Oct 29 02:46:42 2006 +0000
     2.3 @@ -36,6 +36,10 @@
     2.4  			    XiGMiscResolutionInfo **presolutions);
     2.5  extern void XiGMiscChangeResolution(Display *dpy, int screen, int view, 
     2.6  			     int width, int height, int refresh);
     2.7 +
     2.8 +/* SDL addition from Ryan: free memory used by xme. */
     2.9 +extern void XiGMiscDestroy(void);
    2.10 +
    2.11  #endif /* _XME_H_INCLUDED */
    2.12  
    2.13  
     3.1 --- a/src/video/x11/SDL_x11video.c	Fri Oct 27 20:18:24 2006 +0000
     3.2 +++ b/src/video/x11/SDL_x11video.c	Sun Oct 29 02:46:42 2006 +0000
     3.3 @@ -1408,5 +1408,9 @@
     3.4  		/* Direct screen access, no memory buffer */
     3.5  		this->screen->pixels = NULL;
     3.6  	}
     3.7 +
     3.8 +#if SDL_VIDEO_DRIVER_X11_XME
     3.9 +    XiGMiscDestroy();
    3.10 +#endif
    3.11  }
    3.12