diff options
author | António Fernandes <antoniof@gnome.org> | 2021-11-27 10:17:37 +0000 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2021-12-06 10:39:33 +0000 |
commit | cb257a2cbd2159ad405bb3a30580a86389d83b79 (patch) | |
tree | c1ada0f072be60cd9ca6960fe7a4a6ae06b05150 /src/nautilus-location-entry.c | |
parent | 54617c32b33b052acebc1308e1b020e437493087 (diff) | |
download | nautilus-cb257a2cbd2159ad405bb3a30580a86389d83b79.tar.gz |
Revert "general: Stop overriding GtkWidget.destroy()"
This reverts commit 1c83d6af8bb4890dfb279c75506fa9be2a66b6ee.
It did a little to much and this introduced at least one bug: when
going from a regular folder to other-locations:///, the current view
menu keeps displaying invalid actions (New Folder, Properties, etc.),
which, if activated, crash the application.
Let's revert first and do it right in the next commit.
Diffstat (limited to 'src/nautilus-location-entry.c')
-rw-r--r-- | src/nautilus-location-entry.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c index 0cc8ca140..e3066ce7d 100644 --- a/src/nautilus-location-entry.c +++ b/src/nautilus-location-entry.c @@ -576,14 +576,18 @@ finalize (GObject *object) entry = NAUTILUS_LOCATION_ENTRY (object); priv = nautilus_location_entry_get_instance_private (entry); + g_object_unref (priv->completer); g_free (priv->special_text); - g_free (priv->current_directory); + + g_clear_object (&priv->last_location); + g_clear_object (&priv->completion); + g_clear_object (&priv->completions_store); G_OBJECT_CLASS (nautilus_location_entry_parent_class)->finalize (object); } static void -nautilus_location_entry_dispose (GObject *object) +destroy (GtkWidget *object) { NautilusLocationEntry *entry; NautilusLocationEntryPrivate *priv; @@ -598,12 +602,10 @@ nautilus_location_entry_dispose (GObject *object) priv->idle_id = 0; } - g_clear_object (&priv->completer); - g_clear_object (&priv->last_location); - g_clear_object (&priv->completion); - g_clear_object (&priv->completions_store); + g_free (priv->current_directory); + priv->current_directory = NULL; - G_OBJECT_CLASS (nautilus_location_entry_parent_class)->dispose (object); + GTK_WIDGET_CLASS (nautilus_location_entry_parent_class)->destroy (object); } static void @@ -849,10 +851,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); |