From b11eb7bddd52ca823d7c0002d35e2f5c7113a2bd Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Fri, 10 Nov 2006 09:18:26 -0600 Subject: [PATCH] Properly unref stuff --- moo/mooedit/mooprintpreview.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/moo/mooedit/mooprintpreview.c b/moo/mooedit/mooprintpreview.c index 81439a59..fa0a2552 100644 --- a/moo/mooedit/mooprintpreview.c +++ b/moo/mooedit/mooprintpreview.c @@ -55,12 +55,22 @@ _moo_print_preview_init (MooPrintPreview *preview) static void moo_print_preview_finalize (GObject *object) { + guint i; MooPrintPreview *preview = MOO_PRINT_PREVIEW (object); g_object_unref (preview->op); g_object_unref (preview->gtk_preview); + g_object_unref (preview->context); g_object_unref (preview->xml); + if (preview->pages) + { + for (i = 0; i < preview->pages->len; ++i) + if (preview->pages->pdata[i]) + cairo_surface_destroy (preview->pages->pdata[i]); + g_ptr_array_free (preview->pages, TRUE); + } + G_OBJECT_CLASS (_moo_print_preview_parent_class)->finalize (object); }