mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 03:18:05 +02:00
Add comment pondering memory management semantics of cairo_current_target_surface.
NULL out pen->vertices after free. NULL out durface->data after free.
This commit is contained in:
parent
3262cd9f95
commit
7262e1554f
8 changed files with 34 additions and 2 deletions
12
ChangeLog
12
ChangeLog
|
|
@ -1,3 +1,15 @@
|
|||
2003-11-06 Carl Worth <cworth@east.isi.edu>
|
||||
|
||||
* src/cairo.h: Add comment pondering memory management semantics
|
||||
of cairo_current_target_surface.
|
||||
|
||||
* src/cairo_pen.c (_cairo_pen_fini): NULL out pen->vertices after
|
||||
free.
|
||||
|
||||
* src/cairo_image_surface.c
|
||||
(_cairo_image_abstract_surface_destroy): NULL out durface->data
|
||||
after free.
|
||||
|
||||
2003-11-04 Carl Worth <cworth@east.isi.edu>
|
||||
|
||||
* src/cairo_gstate.c (_cairo_gstate_set_target_surface): Enable
|
||||
|
|
|
|||
|
|
@ -349,6 +349,11 @@ _cairo_gstate_current_target_surface (cairo_gstate_t *gstate)
|
|||
if (gstate == NULL)
|
||||
return NULL;
|
||||
|
||||
/* XXX: Do we want this?
|
||||
if (gstate->surface)
|
||||
_cairo_surface_reference (gstate->surface);
|
||||
*/
|
||||
|
||||
return gstate->surface;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -193,8 +193,10 @@ _cairo_image_abstract_surface_destroy (void *abstract_surface)
|
|||
if (surface->ic_image)
|
||||
IcImageDestroy (surface->ic_image);
|
||||
|
||||
if (surface->owns_data)
|
||||
if (surface->owns_data) {
|
||||
free (surface->data);
|
||||
surface->data = NULL;
|
||||
}
|
||||
|
||||
free (surface);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,8 @@ void
|
|||
_cairo_pen_fini (cairo_pen_t *pen)
|
||||
{
|
||||
free (pen->vertices);
|
||||
pen->vertices = NULL;
|
||||
|
||||
_cairo_pen_init_empty (pen);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -490,6 +490,8 @@ cairo_current_miter_limit (cairo_t *cr);
|
|||
extern void __external_linkage
|
||||
cairo_current_matrix (cairo_t *cr, cairo_matrix_t *matrix);
|
||||
|
||||
/* XXX: Need to decide the memory mangement semantics of this
|
||||
function. Should it reference the surface again? */
|
||||
extern cairo_surface_t * __external_linkage
|
||||
cairo_current_target_surface (cairo_t *cr);
|
||||
|
||||
|
|
|
|||
|
|
@ -349,6 +349,11 @@ _cairo_gstate_current_target_surface (cairo_gstate_t *gstate)
|
|||
if (gstate == NULL)
|
||||
return NULL;
|
||||
|
||||
/* XXX: Do we want this?
|
||||
if (gstate->surface)
|
||||
_cairo_surface_reference (gstate->surface);
|
||||
*/
|
||||
|
||||
return gstate->surface;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -193,8 +193,10 @@ _cairo_image_abstract_surface_destroy (void *abstract_surface)
|
|||
if (surface->ic_image)
|
||||
IcImageDestroy (surface->ic_image);
|
||||
|
||||
if (surface->owns_data)
|
||||
if (surface->owns_data) {
|
||||
free (surface->data);
|
||||
surface->data = NULL;
|
||||
}
|
||||
|
||||
free (surface);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,6 +115,8 @@ void
|
|||
_cairo_pen_fini (cairo_pen_t *pen)
|
||||
{
|
||||
free (pen->vertices);
|
||||
pen->vertices = NULL;
|
||||
|
||||
_cairo_pen_init_empty (pen);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue