mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 22:48:07 +02:00
Fix to delay XFreePixmap until cairo_surface_destroy.
This commit is contained in:
parent
9edacaf780
commit
6b582a836a
4 changed files with 19 additions and 2 deletions
|
|
@ -1,3 +1,9 @@
|
|||
2003-09-30 Carl Worth <cworth@east.isi.edu>
|
||||
|
||||
* src/cairo_surface.c (cairo_surface_destroy):
|
||||
(cairo_surface_create_similar_solid): Fix to delay XFreePixmap
|
||||
until cairo_surface_destroy.
|
||||
|
||||
2003-09-29 Carl Worth <cworth@east.isi.edu>
|
||||
|
||||
* TODO: Remove arc notes since arcs are done.
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ cairo_surface_create_for_drawable (Display *dpy,
|
|||
|
||||
surface->gc = 0;
|
||||
surface->drawable = drawable;
|
||||
surface->owns_pixmap = 0;
|
||||
surface->visual = visual;
|
||||
|
||||
if (! XRenderQueryVersion (dpy, &surface->render_major, &surface->render_minor)) {
|
||||
|
|
@ -207,6 +208,7 @@ cairo_surface_create_for_image (char *data,
|
|||
|
||||
surface->gc = 0;
|
||||
surface->drawable = 0;
|
||||
surface->owns_pixmap = 0;
|
||||
surface->visual = NULL;
|
||||
surface->render_major = -1;
|
||||
surface->render_minor = -1;
|
||||
|
|
@ -276,7 +278,7 @@ cairo_surface_create_similar_solid (cairo_surface_t *other,
|
|||
NULL,
|
||||
format,
|
||||
DefaultColormap (dpy, scr));
|
||||
XFreePixmap (surface->dpy, pix);
|
||||
surface->owns_pixmap = 1;
|
||||
} else {
|
||||
char *data;
|
||||
int stride;
|
||||
|
|
@ -326,6 +328,9 @@ cairo_surface_destroy (cairo_surface_t *surface)
|
|||
if (surface->picture)
|
||||
XRenderFreePicture (surface->dpy, surface->picture);
|
||||
|
||||
if (surface->owns_pixmap)
|
||||
XFreePixmap (surface->dpy, surface->drawable);
|
||||
|
||||
if (surface->icformat)
|
||||
IcFormatDestroy (surface->icformat);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ cairo_surface_create_for_drawable (Display *dpy,
|
|||
|
||||
surface->gc = 0;
|
||||
surface->drawable = drawable;
|
||||
surface->owns_pixmap = 0;
|
||||
surface->visual = visual;
|
||||
|
||||
if (! XRenderQueryVersion (dpy, &surface->render_major, &surface->render_minor)) {
|
||||
|
|
@ -207,6 +208,7 @@ cairo_surface_create_for_image (char *data,
|
|||
|
||||
surface->gc = 0;
|
||||
surface->drawable = 0;
|
||||
surface->owns_pixmap = 0;
|
||||
surface->visual = NULL;
|
||||
surface->render_major = -1;
|
||||
surface->render_minor = -1;
|
||||
|
|
@ -276,7 +278,7 @@ cairo_surface_create_similar_solid (cairo_surface_t *other,
|
|||
NULL,
|
||||
format,
|
||||
DefaultColormap (dpy, scr));
|
||||
XFreePixmap (surface->dpy, pix);
|
||||
surface->owns_pixmap = 1;
|
||||
} else {
|
||||
char *data;
|
||||
int stride;
|
||||
|
|
@ -326,6 +328,9 @@ cairo_surface_destroy (cairo_surface_t *surface)
|
|||
if (surface->picture)
|
||||
XRenderFreePicture (surface->dpy, surface->picture);
|
||||
|
||||
if (surface->owns_pixmap)
|
||||
XFreePixmap (surface->dpy, surface->drawable);
|
||||
|
||||
if (surface->icformat)
|
||||
IcFormatDestroy (surface->icformat);
|
||||
|
||||
|
|
|
|||
|
|
@ -249,6 +249,7 @@ struct cairo_surface {
|
|||
GC gc;
|
||||
Drawable drawable;
|
||||
Visual *visual;
|
||||
int owns_pixmap;
|
||||
|
||||
int render_major;
|
||||
int render_minor;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue