Fix memory leak of image pixmap

This commit is contained in:
Carl Worth 2002-11-02 10:24:12 +00:00
parent e39a088a29
commit ea0104b2c0
3 changed files with 17 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2002-11-02 Carl Worth <cworth@isi.edu>
* xrsurface.c (_XrSurfaceSetImage): Fixed leak of the image
pixmap.
2002-11-01 Carl Worth <cworth@east.isi.edu>
* xrsurface.c (_XrSurfaceSetImage): Prelimary image

View file

@ -135,6 +135,12 @@ _XrSurfaceSetImage(XrSurface *surface,
XPutImage(surface->dpy, surface->drawable, surface->gc,
image, 0, 0, 0, 0, width, height);
/* I want to free the pixmap, so I have to commit to an xc_surface
to reference the pixmap in the Picture. */
_XrSurfaceGetXcSurface(surface);
XFreePixmap(surface->dpy, pix);
/* Foolish XDestroyImage thinks it can free my data, but I won't
stand for it. */
image->data = NULL;

View file

@ -135,6 +135,12 @@ _XrSurfaceSetImage(XrSurface *surface,
XPutImage(surface->dpy, surface->drawable, surface->gc,
image, 0, 0, 0, 0, width, height);
/* I want to free the pixmap, so I have to commit to an xc_surface
to reference the pixmap in the Picture. */
_XrSurfaceGetXcSurface(surface);
XFreePixmap(surface->dpy, pix);
/* Foolish XDestroyImage thinks it can free my data, but I won't
stand for it. */
image->data = NULL;