From 431c5e299fa07934c3fcf01cf32ad9a95506ed37 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 4 Jul 2020 10:42:22 +0200 Subject: [PATCH] Add finalize methods to some classes which don't have them. These may not be strictly necessary, but can make tracking for leaks easier by placing a diagnostic in the method. --- src/ui/gui/psppire-data-editor.c | 8 ++++++++ src/ui/gui/psppire-data-sheet.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 44dd119974..181e5cbf3d 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -80,6 +80,13 @@ psppire_data_editor_get_type (void) static GObjectClass * parent_class = NULL; +static void +psppire_data_editor_finalize (GObject *obj) +{ + /* Chain up to the parent class */ + G_OBJECT_CLASS (parent_class)->finalize (obj); +} + static void psppire_data_editor_dispose (GObject *obj) { @@ -258,6 +265,7 @@ psppire_data_editor_class_init (PsppireDataEditorClass *klass) parent_class = g_type_class_peek_parent (klass); object_class->dispose = psppire_data_editor_dispose; + object_class->finalize = psppire_data_editor_finalize; object_class->set_property = psppire_data_editor_set_property; object_class->get_property = psppire_data_editor_get_property; diff --git a/src/ui/gui/psppire-data-sheet.c b/src/ui/gui/psppire-data-sheet.c index c5ea4b644a..a842f36aef 100644 --- a/src/ui/gui/psppire-data-sheet.c +++ b/src/ui/gui/psppire-data-sheet.c @@ -348,6 +348,13 @@ G_DEFINE_TYPE (PsppireDataSheet, psppire_data_sheet, SSW_TYPE_SHEET) static GObjectClass * parent_class = NULL; static gboolean dispose_has_run = FALSE; +static void +psppire_data_sheet_finalize (GObject *obj) +{ + /* Chain up to the parent class */ + G_OBJECT_CLASS (parent_class)->finalize (obj); +} + static void psppire_data_sheet_dispose (GObject *obj) { @@ -370,6 +377,7 @@ psppire_data_sheet_class_init (PsppireDataSheetClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); object_class->dispose = psppire_data_sheet_dispose; + object_class->finalize = psppire_data_sheet_finalize; parent_class = g_type_class_peek_parent (class); } -- 2.30.2