diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-29 21:50:22 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-30 10:16:23 +0100 |
commit | 3ae57234644c3756785c551beffe584f837b0273 (patch) | |
tree | bc428891d10bed05d705a703bb1e0d1de423bb8e /boilerplate/cairo-boilerplate-pdf.c | |
parent | f08cc311af1248b39c3e757ef192515ed8506862 (diff) | |
download | cairo-3ae57234644c3756785c551beffe584f837b0273.tar.gz |
boilerplate: Ensure that the recording surfaces are finished.
Be paranoid and explicitly call finish to cleanup self-referential leaks
when using paginated/recording surfaces.
Diffstat (limited to 'boilerplate/cairo-boilerplate-pdf.c')
-rw-r--r-- | boilerplate/cairo-boilerplate-pdf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c index d45e6ca80..8459f5824 100644 --- a/boilerplate/cairo-boilerplate-pdf.c +++ b/boilerplate/cairo-boilerplate-pdf.c @@ -137,6 +137,7 @@ _cairo_boilerplate_pdf_finish_surface (cairo_surface_t *surface) if (status) return status; + cairo_surface_finish (surface); status = cairo_surface_status (surface); if (status) return status; @@ -204,8 +205,10 @@ static void _cairo_boilerplate_pdf_cleanup (void *closure) { pdf_target_closure_t *ptc = closure; - if (ptc->target) + if (ptc->target) { + cairo_surface_finish (ptc->target); cairo_surface_destroy (ptc->target); + } free (ptc->filename); free (ptc); } |