[nautilus] list-base: Clear scroll_to idle handler before clearing list-base



commit 6f81f1b46f58af0c5d6a55882a157e72227d02ca
Author: Corey Berla <corey berla me>
Date:   Tue Jul 12 07:32:09 2022 -0700

    list-base: Clear scroll_to idle handler before clearing list-base
    
    When you the navigation buttons to go back and forth very quickly
    you can reliably get Nautilus to crash.  This happens because there
    is an idle timer set to scroll to the item to be selected.  If you
    change the view before the scroll has happened, the handler will
    attempt to scroll to a non-existent item.
    
    Clear scroll_to_file_handle_id before clearing all view items
    in real_clear().

 src/nautilus-list-base.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index e3156aa54..a28468dfa 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -955,6 +955,7 @@ real_clear (NautilusFilesView *files_view)
     NautilusListBase *self = NAUTILUS_LIST_BASE (files_view);
     NautilusListBasePrivate *priv = nautilus_list_base_get_instance_private (self);
 
+    g_clear_handle_id (&priv->scroll_to_file_handle_id, g_source_remove);
     nautilus_view_model_remove_all_items (priv->model);
 }
 


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