[mutter/wayland] stack: Don't take a weak pointer



commit 2b2b2d319191f5e2af725b6d3a1e24384ca7781b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Nov 19 13:08:34 2013 -0500

    stack: Don't take a weak pointer
    
    Since this is stored in an array full of data that will be copied
    around, we can't rely on pointer addresses for every item in a stack
    not changing.
    
    I don't see any reason that we even have a weak pointer, either.
    This code looks safe to me without it.

 src/core/stack.c |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)
---
diff --git a/src/core/stack.c b/src/core/stack.c
index 96e88e7..911dc35 100644
--- a/src/core/stack.c
+++ b/src/core/stack.c
@@ -92,16 +92,6 @@ meta_stack_new (MetaScreen *screen)
 static void
 free_last_all_root_children_stacked_cache (MetaStack *stack)
 {
-  unsigned int i;
-
-  for (i = 0; i < stack->last_all_root_children_stacked->len; i++)
-    {
-      MetaStackWindow *window = &g_array_index (stack->last_all_root_children_stacked, MetaStackWindow, i);
-      if (window->any.type == META_WINDOW_CLIENT_TYPE_WAYLAND)
-        g_object_remove_weak_pointer (G_OBJECT (window->wayland.meta_window),
-                                      (gpointer *)&window->wayland.meta_window);
-    }
-
   g_array_free (stack->last_all_root_children_stacked, TRUE);
   stack->last_all_root_children_stacked = NULL;
 }
@@ -1345,8 +1335,6 @@ stack_sync_to_xserver (MetaStack *stack)
            * stale because the corresponding window has been freed we
            * associate a weak pointer with the new window. */
           new = &g_array_index (all_root_children_stacked, MetaStackWindow, all_root_children_stacked->len - 
1);
-          g_object_add_weak_pointer (G_OBJECT (new->wayland.meta_window),
-                                     (gpointer *)&new->wayland.meta_window);
         }
     }
 


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