Index: src/video/Xext/extensions/xme.h =================================================================== --- src/video/Xext/extensions/xme.h (revision 2820) +++ src/video/Xext/extensions/xme.h (working copy) @@ -36,6 +36,10 @@ XiGMiscResolutionInfo **presolutions); extern void XiGMiscChangeResolution(Display *dpy, int screen, int view, int width, int height, int refresh); + +/* SDL addition from Ryan: free memory used by xme. */ +extern void XiGMiscDestroy(void); + #endif /* _XME_H_INCLUDED */ Index: src/video/Xext/XME/xme.c =================================================================== --- src/video/Xext/XME/xme.c (revision 2820) +++ src/video/Xext/XME/xme.c (working copy) @@ -393,3 +393,13 @@ return (rep.success ? xTrue : xFalse); } + +/* SDL addition from Ryan: free memory used by xme. */ +void XiGMiscDestroy(void) +{ + if (xigmisc_info) { + XextDestroyExtension(xigmisc_info); + xigmisc_info = NULL; + } +} + Index: src/video/x11/SDL_x11video.c =================================================================== --- src/video/x11/SDL_x11video.c (revision 2820) +++ src/video/x11/SDL_x11video.c (working copy) @@ -1408,5 +1408,9 @@ /* Direct screen access, no memory buffer */ this->screen->pixels = NULL; } + +#if SDL_VIDEO_DRIVER_X11_XME + XiGMiscDestroy(); +#endif }