comparison src/video/x11/SDL_x11render.c @ 4609:630002c8be85

Fix cleanup functions.
author Sunny Sachanandani <sunnysachanandani@gmail.com>
date Wed, 21 Jul 2010 18:38:40 +0530
parents ff7b00d4b0d3
children 32991e17e2b6
comparison
equal deleted inserted replaced
4608:ff7b00d4b0d3 4609:630002c8be85
2039 XSync(renderdata->display, False); 2039 XSync(renderdata->display, False);
2040 shmdt(data->shminfo.shmaddr); 2040 shmdt(data->shminfo.shmaddr);
2041 data->pixels = NULL; 2041 data->pixels = NULL;
2042 } 2042 }
2043 #endif 2043 #endif
2044 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
2045 if (renderdata->use_xrender) {
2046 if (data->picture) {
2047 XRenderFreePicture(renderdata->display, data->picture);
2048 }
2049 }
2050 #endif
2044 if (data->scaling_image) { 2051 if (data->scaling_image) {
2045 SDL_free(data->scaling_image->data); 2052 SDL_free(data->scaling_image->data);
2046 data->scaling_image->data = NULL; 2053 data->scaling_image->data = NULL;
2047 XDestroyImage(data->scaling_image); 2054 XDestroyImage(data->scaling_image);
2048 } 2055 }
2063 for (i = 0; i < SDL_arraysize(data->pixmaps); ++i) { 2070 for (i = 0; i < SDL_arraysize(data->pixmaps); ++i) {
2064 if (data->pixmaps[i] != None) { 2071 if (data->pixmaps[i] != None) {
2065 XFreePixmap(data->display, data->pixmaps[i]); 2072 XFreePixmap(data->display, data->pixmaps[i]);
2066 } 2073 }
2067 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER 2074 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
2068 if (data->pixmap_picts[i] != None) { 2075 if (data->use_xrender && data->pixmap_picts[i]) {
2069 XRenderFreePicture(data->display, data->pixmap_picts[i]); 2076 XRenderFreePicture(data->display, data->pixmap_picts[i]);
2070 } 2077 }
2071 #endif 2078 #endif
2072 } 2079 }
2073 if (data->gc) { 2080 if (data->gc) {
2074 XFreeGC(data->display, data->gc); 2081 XFreeGC(data->display, data->gc);
2075 } 2082 }
2076 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER 2083 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
2077 if (data->stencil_gc) { 2084 if (data->use_xrender) {
2078 XFreeGC(data->display, data->stencil_gc); 2085 if (data->stencil_gc) {
2079 } 2086 XFreeGC(data->display, data->stencil_gc);
2080 if (data->stencil) { 2087 }
2081 XFreePixmap(data->display, data->stencil); 2088 if (data->stencil) {
2082 } 2089 XFreePixmap(data->display, data->stencil);
2083 if (data->drawable_pict) { 2090 }
2084 XRenderFreePicture(data->display, data->drawable_pict); 2091 if (data->stencil_pict) {
2085 } 2092 XRenderFreePicture(data->display, data->stencil_pict);
2086 if (data->xwindow_pict) { 2093 }
2087 XRenderFreePicture(data->display, data->xwindow_pict); 2094 if (data->xwindow_pict) {
2095 XRenderFreePicture(data->display, data->xwindow_pict);
2096 }
2097 #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
2098 if (data->use_xdamage && data->stencil_damage) {
2099 XDamageDestroy(data->display, data->stencil_damage);
2100 }
2101 #endif
2088 } 2102 }
2089 #endif 2103 #endif
2090 SDL_FreeDirtyRects(&data->dirty); 2104 SDL_FreeDirtyRects(&data->dirty);
2091 SDL_free(data); 2105 SDL_free(data);
2092 } 2106 }