[libdazzle] animation: use connect_object for signals



commit f88f089a45e1c58bbcc23bef424cc1d19958051d
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jun 14 03:31:30 2018 -0700

    animation: use connect_object for signals
    
    We need to be extra careful with our signal tracking, so use the object
    tracking in gsignal to help with that.

 src/animation/dzl-animation.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/animation/dzl-animation.c b/src/animation/dzl-animation.c
index 2023f51..629f679 100644
--- a/src/animation/dzl-animation.c
+++ b/src/animation/dzl-animation.c
@@ -629,15 +629,17 @@ dzl_animation_start (DzlAnimation *animation)
       animation->begin_time = gdk_frame_clock_get_frame_time (animation->frame_clock);
       animation->end_time = animation->begin_time + (animation->duration_msec * 1000L);
       animation->tween_handler =
-        g_signal_connect (animation->frame_clock,
-                          "update",
-                          G_CALLBACK (dzl_animation_widget_tick_cb),
-                          animation);
+        g_signal_connect_object (animation->frame_clock,
+                                 "update",
+                                 G_CALLBACK (dzl_animation_widget_tick_cb),
+                                 animation,
+                                 0);
       animation->after_paint_handler =
-        g_signal_connect (animation->frame_clock,
-                          "after-paint",
-                          G_CALLBACK (dzl_animation_widget_after_paint_cb),
-                          animation);
+        g_signal_connect_object (animation->frame_clock,
+                                 "after-paint",
+                                 G_CALLBACK (dzl_animation_widget_after_paint_cb),
+                                 animation,
+                                 0);
       gdk_frame_clock_begin_updating (animation->frame_clock);
     }
   else


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