diff options
author | António Fernandes <antoniof@gnome.org> | 2021-11-27 10:25:00 +0000 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2021-12-06 10:39:33 +0000 |
commit | d5caa0b021a56c9765a321954a48f7d630629736 (patch) | |
tree | bea0b95fef4c514ac3497801e030ad03f29047f9 /src/nautilus-location-entry.c | |
parent | cb257a2cbd2159ad405bb3a30580a86389d83b79 (diff) | |
download | nautilus-d5caa0b021a56c9765a321954a48f7d630629736.tar.gz |
general: Stop overriding GtkWidget.destroy()
It's gone in GTK4.
Anything we are doing on ::destroy can be done on ::dispose().
Extra care must be taken, however, because GObject.dispose() may be
run multiple times; for this reason, move some things to .finalize().
Diffstat (limited to 'src/nautilus-location-entry.c')
-rw-r--r-- | src/nautilus-location-entry.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c index e3066ce7d..6d8f2bf35 100644 --- a/src/nautilus-location-entry.c +++ b/src/nautilus-location-entry.c @@ -582,12 +582,13 @@ finalize (GObject *object) g_clear_object (&priv->last_location); g_clear_object (&priv->completion); g_clear_object (&priv->completions_store); + g_free (priv->current_directory); G_OBJECT_CLASS (nautilus_location_entry_parent_class)->finalize (object); } static void -destroy (GtkWidget *object) +nautilus_location_entry_dispose (GObject *object) { NautilusLocationEntry *entry; NautilusLocationEntryPrivate *priv; @@ -602,10 +603,8 @@ destroy (GtkWidget *object) priv->idle_id = 0; } - g_free (priv->current_directory); - priv->current_directory = NULL; - GTK_WIDGET_CLASS (nautilus_location_entry_parent_class)->destroy (object); + G_OBJECT_CLASS (nautilus_location_entry_parent_class)->dispose (object); } static void @@ -851,10 +850,10 @@ nautilus_location_entry_class_init (NautilusLocationEntryClass *class) GtkBindingSet *binding_set; widget_class = GTK_WIDGET_CLASS (class); - widget_class->destroy = destroy; widget_class->event = nautilus_location_entry_on_event; gobject_class = G_OBJECT_CLASS (class); + gobject_class->dispose = nautilus_location_entry_dispose; gobject_class->finalize = finalize; entry_class = GTK_ENTRY_CLASS (class); |