[gnome-shell] StIcon: use g_signal_connect_object() for safety



commit ef9c50e63a01fee2af43d5b8f45cbfc325f51d43
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Mar 27 17:54:41 2013 +0100

    StIcon: use g_signal_connect_object() for safety
    
    Prevent a crash in case an icon is destroyed before the texture
    finishes loading, and something else is keeping the texture alive
    for any reason.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=696720

 src/st/st-icon.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/st/st-icon.c b/src/st/st-icon.c
index 4d149e1..b29744b 100644
--- a/src/st/st-icon.c
+++ b/src/st/st-icon.c
@@ -410,8 +410,8 @@ st_icon_finish_update (StIcon *icon)
       st_icon_update_shadow_material (icon);
 
       /* "pixbuf-change" is actually a misnomer for "texture-changed" */
-      g_signal_connect (priv->icon_texture, "pixbuf-change",
-                        G_CALLBACK (on_pixbuf_changed), icon);
+      g_signal_connect_object (priv->icon_texture, "pixbuf-change",
+                               G_CALLBACK (on_pixbuf_changed), icon, 0);
     }
 }
 
@@ -469,7 +469,7 @@ st_icon_update (StIcon *icon)
       else
         {
           /* Will be shown when fully loaded */
-          priv->opacity_handler_id = g_signal_connect (priv->pending_texture, "notify::opacity", G_CALLBACK 
(opacity_changed_cb), icon);
+          priv->opacity_handler_id = g_signal_connect_object (priv->pending_texture, "notify::opacity", 
G_CALLBACK (opacity_changed_cb), icon, 0);
         }
     }
   else if (priv->icon_texture)


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