Skip to content

Commit

Permalink
Closing minor memory leak in XME code.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 29, 2006
1 parent b9b1b4d commit daf7a5a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/video/Xext/XME/xme.c
Expand Up @@ -393,3 +393,13 @@ Bool XiGMiscFullScreen(Display *dpy, int screen, XID window, XID cmap)
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;
}
}

4 changes: 4 additions & 0 deletions src/video/Xext/extensions/xme.h
Expand Up @@ -36,6 +36,10 @@ extern int XiGMiscQueryResolutions(Display *dpy, int screen, int view,
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 */


4 changes: 4 additions & 0 deletions src/video/x11/SDL_x11video.c
Expand Up @@ -1408,5 +1408,9 @@ void X11_VideoQuit(_THIS)
/* Direct screen access, no memory buffer */
this->screen->pixels = NULL;
}

#if SDL_VIDEO_DRIVER_X11_XME
XiGMiscDestroy();
#endif
}

0 comments on commit daf7a5a

Please sign in to comment.