[nautilus] nautilus-view: Don't update if not active or destroyed



commit 70b9ca01ad60cdeef8bc09e57d3bb60c5a1aaad0
Author: Carlos Soriano <csoriano gnome org>
Date:   Mon Feb 2 10:57:25 2015 +0100

    nautilus-view: Don't update if not active or destroyed
    
    For context menus we update menus on a timeout. For the cases of
    the toolbar afaik that's not needed so we update directly.
    The schedulers for the context menu has a protection against updating
    if the view is destroyed or not active.
    Apply that protection to the update of the toolbar so we don't crash
    if we call it while destroying.

 src/nautilus-view.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 02a9c38..50139d7 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -6355,6 +6355,13 @@ nautilus_view_update_toolbar_menus (NautilusView *view)
 
        g_assert (NAUTILUS_IS_VIEW (view));
 
+       /* Don't update after destroy (#349551),
+        * or if we are not active.
+        */
+       if (view->details->slot == NULL ||
+           !view->details->active) {
+               return;
+       }
        window = nautilus_view_get_window (view);
        toolbar = NAUTILUS_TOOLBAR (nautilus_window_get_toolbar (window));
        nautilus_toolbar_reset_menus (toolbar);


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