return r;
}
+void
+xr_rendering_destroy (struct xr_rendering *r)
+{
+ if (r)
+ {
+ output_item_unref (r->item);
+ render_page_unref (r->page);
+ free (r);
+ }
+}
+
void
xr_rendering_measure (struct xr_rendering *r, int *w, int *h)
{
/* PSPP - a program for statistical analysis.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010, 2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
struct xr_rendering *xr_rendering_create (struct xr_driver *,
const struct output_item *,
cairo_t *);
+void xr_rendering_destroy (struct xr_rendering *);
void xr_rendering_apply_options (struct xr_rendering *, struct string_map *o);
void xr_rendering_measure (struct xr_rendering *, int *w, int *h);
return TRUE;
}
+static void
+free_rendering (gpointer rendering_)
+{
+ struct xr_rendering *rendering = rendering_;
+ xr_rendering_destroy (rendering);
+}
+
void
psppire_output_view_put (struct psppire_output_view *view,
const struct output_item *item)
drawing_area = gtk_drawing_area_new ();
- g_object_set_data (G_OBJECT (drawing_area), "rendering", r);
+ g_object_set_data_full (G_OBJECT (drawing_area), "rendering", r, free_rendering);
g_signal_connect (drawing_area, "realize",
G_CALLBACK (on_dwgarea_realize), view);
g_signal_connect (drawing_area, "expose_event",
if (view->print_settings != NULL)
g_object_unref (view->print_settings);
+ xr_driver_destroy (view->xr);
+
free (view);
}
\f