[gnome-shell] Revert "st: Keep weak ref on texture cache bound texture source"



commit 19e5f35569d78b678963b633121bc4af2f7611d8
Author: Sebastian Keller <skeller gnome org>
Date:   Thu Feb 25 17:52:00 2021 +0100

    Revert "st: Keep weak ref on texture cache bound texture source"
    
    This reverts commit 87558efbf130ec64b445da808b2bc162aebf352d.
    
    The commit did not fix the bug it was supposed to fix, it just
    complicated the code. The hopefully correct fix is in the previous
    commit.
    
    The point of this commit was to ensure everything gets removed when
    bind->source gets removed. This however was already the case since the
    signal handler was already connected to bind->source and has a
    destructor registered that takes care of everything. And since gobject
    destroys its signal handlers before it clears the weak refs, this new
    weak ref was effectively never being used.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1718>

 src/st/st-texture-cache.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index b27cac4c10..15c33f0296 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -797,10 +797,6 @@ st_texture_cache_bind_weak_notify (gpointer     data,
 {
   StTextureCachePropertyBind *bind = data;
   bind->weakref_active = FALSE;
-  if (G_OBJECT (bind->image) != source_location)
-    g_object_weak_unref (G_OBJECT (bind->image), st_texture_cache_bind_weak_notify, bind);
-  if (bind->source != source_location)
-    g_object_weak_unref (G_OBJECT (bind->source), st_texture_cache_bind_weak_notify, bind);
   g_signal_handler_disconnect (bind->source, bind->notify_signal_id);
 }
 
@@ -808,13 +804,8 @@ static void
 st_texture_cache_free_bind (gpointer data)
 {
   StTextureCachePropertyBind *bind = data;
-
   if (bind->weakref_active)
-    {
-      g_object_weak_unref (G_OBJECT (bind->image), st_texture_cache_bind_weak_notify, bind);
-      g_object_weak_unref (G_OBJECT (bind->source), st_texture_cache_bind_weak_notify, bind);
-    }
-
+    g_object_weak_unref (G_OBJECT (bind->image), st_texture_cache_bind_weak_notify, bind);
   g_free (bind);
 }
 
@@ -848,7 +839,6 @@ st_texture_cache_bind_cairo_surface_property (StTextureCache    *cache,
   st_texture_cache_reset_texture (bind, property_name);
 
   g_object_weak_ref (G_OBJECT (bind->image), st_texture_cache_bind_weak_notify, bind);
-  g_object_weak_ref (G_OBJECT (bind->source), st_texture_cache_bind_weak_notify, bind);
   bind->weakref_active = TRUE;
 
   notify_key = g_strdup_printf ("notify::%s", property_name);


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