diff options
author | Nelson Benítez León <nbenitezl+gnome@gmail.com> | 2017-10-26 21:32:32 +0500 |
---|---|---|
committer | Ernestas Kulik <ernestask@gnome.org> | 2018-03-24 19:56:14 +0200 |
commit | 68e43ba25528f7256583d1f63d5c439df0827e31 (patch) | |
tree | a03d1a210e3351eaa3b7e560c0f42e950b89447c | |
parent | 37c21af2eb36ad55d3faee47d75527fcf44f9762 (diff) | |
download | nautilus-68e43ba25528f7256583d1f63d5c439df0827e31.tar.gz |
nautilus-files-view: fix crash on search view
Fix crash caused by commit 3aba356a when switching to
search view. Crash occured because of timeout being
executed for a destroyed view. So we now save timeout id
to make sure we remove timeout when its view it's being
destroyed.
https://gitlab.gnome.org/GNOME/nautilus/issues/73
-rw-r--r-- | src/nautilus-files-view.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index 30e5a143d..274fefa34 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -258,6 +258,7 @@ typedef struct /* Floating bar */ guint floating_bar_set_status_timeout_id; guint floating_bar_loading_timeout_id; + guint floating_bar_set_passthrough_timeout_id; GtkWidget *floating_bar; /* Toolbar menu */ @@ -539,6 +540,8 @@ remove_floating_bar_passthrough (gpointer data) priv = nautilus_files_view_get_instance_private (NAUTILUS_FILES_VIEW (data)); gtk_overlay_set_overlay_pass_through (GTK_OVERLAY (priv->overlay), priv->floating_bar, FALSE); + priv->floating_bar_set_passthrough_timeout_id = 0; + return G_SOURCE_REMOVE; } @@ -570,11 +573,18 @@ set_floating_bar_status (NautilusFilesView *view, status_data->detail_status = g_strdup (detail_status); status_data->view = view; + if (priv->floating_bar_set_passthrough_timeout_id != 0) + { + g_source_remove (priv->floating_bar_set_passthrough_timeout_id); + priv->floating_bar_set_passthrough_timeout_id = 0; + } /* Activate passthrough on the floating bar just long enough for a * potential double click to happen, so to not interfere with it */ gtk_overlay_set_overlay_pass_through (GTK_OVERLAY (priv->overlay), priv->floating_bar, TRUE); - g_timeout_add ((guint) double_click_time, remove_floating_bar_passthrough, view); + priv->floating_bar_set_passthrough_timeout_id = g_timeout_add ((guint) double_click_time, + remove_floating_bar_passthrough, + view); /* waiting for half of the double-click-time before setting * the status seems to be a good approximation of not setting it @@ -3159,6 +3169,12 @@ nautilus_files_view_destroy (GtkWidget *object) priv->floating_bar_loading_timeout_id = 0; } + if (priv->floating_bar_set_passthrough_timeout_id != 0) + { + g_source_remove (priv->floating_bar_set_passthrough_timeout_id); + priv->floating_bar_set_passthrough_timeout_id = 0; + } + g_signal_handlers_disconnect_by_func (nautilus_preferences, schedule_update_context_menus, view); g_signal_handlers_disconnect_by_func (nautilus_preferences, |