From 97f4d44766c515d2d228d95323f1af447d700aee Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 20 May 2010 07:22:52 -0700 Subject: [PATCH] cairo: Implement xr_driver_destroy() and use it during printing. This function was omitted by oversight earlier. --- src/output/cairo.c | 12 ++++++++++++ src/ui/gui/psppire-output-window.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/output/cairo.c b/src/output/cairo.c index a1445bcf..68c3eb81 100644 --- a/src/output/cairo.c +++ b/src/output/cairo.c @@ -928,6 +928,18 @@ xr_driver_create (cairo_t *cairo, struct string_map *options) return xr; } +/* Destroy XR, which should have been created with xr_driver_create(). Any + cairo_t added to XR is not destroyed, because it is owned by the client. */ +void +xr_driver_destroy (struct xr_driver *xr) +{ + if (xr != NULL) + { + xr->cairo = NULL; + output_driver_destroy (&xr->driver); + } +} + static struct xr_rendering * xr_rendering_create_text (struct xr_driver *xr, const char *text, cairo_t *cr) { diff --git a/src/ui/gui/psppire-output-window.c b/src/ui/gui/psppire-output-window.c index f11b0057..6d1cd46c 100644 --- a/src/ui/gui/psppire-output-window.c +++ b/src/ui/gui/psppire-output-window.c @@ -685,7 +685,7 @@ end_print (GtkPrintOperation *operation, GtkPrintContext *context, PsppireOutputWindow *window) { - // xr_driver_destroy (window->print_xrd); + xr_driver_destroy (window->print_xrd); } -- 2.30.2