From 3614ff3ba9589f8baa0d4f573631e1b6c26eb110 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Thu, 5 Jul 2012 20:33:58 +0200 Subject: [PATCH 05/11] PsppireDataStore: Move datasheet_destroy from dispose to finalize This actually destroys stuff, not merely unreffing. So it belongs in finalize. --- src/ui/gui/psppire-data-store.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 83933c4..047cca7 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -389,6 +389,13 @@ psppire_data_store_set_dictionary (PsppireDataStore *data_store, PsppireDict *di static void psppire_data_store_finalize (GObject *object) { + PsppireDataStore *ds = PSPPIRE_DATA_STORE (object); + + if (ds->datasheet) + { + datasheet_destroy (ds->datasheet); + ds->datasheet = NULL; + } /* must chain up */ (* parent_class->finalize) (object); @@ -403,11 +410,6 @@ psppire_data_store_dispose (GObject *object) if (ds->dispose_has_run) return; - if (ds->datasheet) - { - datasheet_destroy (ds->datasheet); - ds->datasheet = NULL; - } /* must chain up */ (* parent_class->dispose) (object); -- 1.7.2.5