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 3885 a10bddfdc40f
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
--- a/src/video/Xext/XME/xme.c	Fri Oct 27 20:18:24 2006 +0000
+++ b/src/video/Xext/XME/xme.c	Sun Oct 29 02:46:42 2006 +0000
@@ -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;
+    }
+}
+
--- a/src/video/Xext/extensions/xme.h	Fri Oct 27 20:18:24 2006 +0000
+++ b/src/video/Xext/extensions/xme.h	Sun Oct 29 02:46:42 2006 +0000
@@ -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 */
 
 
--- a/src/video/x11/SDL_x11video.c	Fri Oct 27 20:18:24 2006 +0000
+++ b/src/video/x11/SDL_x11video.c	Sun Oct 29 02:46:42 2006 +0000
@@ -1408,5 +1408,9 @@
 		/* Direct screen access, no memory buffer */
 		this->screen->pixels = NULL;
 	}
+
+#if SDL_VIDEO_DRIVER_X11_XME
+    XiGMiscDestroy();
+#endif
 }