[gnome-builder] source-view-mode: use destroy instead of finalize



commit 0d95887083dfb894b4c6155a3937a3ae1eb04434
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jul 20 15:24:39 2017 -0700

    source-view-mode: use destroy instead of finalize
    
    We want to clean things up sooner, and be less likely to leak
    things. So use destroy which is called from dispose.

 libide/sourceview/ide-source-view-mode.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/libide/sourceview/ide-source-view-mode.c b/libide/sourceview/ide-source-view-mode.c
index 4ed2c0b..92d9bb3 100644
--- a/libide/sourceview/ide-source-view-mode.c
+++ b/libide/sourceview/ide-source-view-mode.c
@@ -146,9 +146,9 @@ ide_source_view_mode_get_keep_mark_on_char (IdeSourceViewMode *self)
 }
 
 static void
-ide_source_view_mode_finalize (GObject *object)
+ide_source_view_mode_destroy (GtkWidget *widget)
 {
-  IdeSourceViewMode *self = IDE_SOURCE_VIEW_MODE (object);
+  IdeSourceViewMode *self = IDE_SOURCE_VIEW_MODE (widget);
 
   g_clear_object (&self->view);
   g_clear_pointer (&self->name, g_free);
@@ -156,7 +156,7 @@ ide_source_view_mode_finalize (GObject *object)
   g_clear_pointer (&self->display_name, g_free);
   self->type = 0;
 
-  G_OBJECT_CLASS (ide_source_view_mode_parent_class)->finalize (object);
+  GTK_WIDGET_CLASS (ide_source_view_mode_parent_class)->destroy (widget);
 }
 
 static void
@@ -247,9 +247,10 @@ ide_source_view_mode_class_init (IdeSourceViewModeClass *klass)
   GtkBindingSet *binding_set, *parent_binding_set;
   GType type;
 
-  object_class->finalize = ide_source_view_mode_finalize;
   object_class->get_property = ide_source_view_mode_get_property;
 
+  widget_class->destroy = ide_source_view_mode_destroy;
+
   gtk_widget_class_set_css_name (widget_class, "idesourceviewmode");
 
   properties [PROP_NAME] =


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]