mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-04 08:17:59 +02:00
Fix memory leak of image pixmap
This commit is contained in:
parent
e39a088a29
commit
ea0104b2c0
3 changed files with 17 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue