summaryrefslogtreecommitdiff
path: root/src/animation
diff options
context:
space:
mode:
authorJoshua Lee <lee.son.wai@gmail.com>2020-06-16 18:46:53 +0100
committerJoshua Lee <lee.son.wai@gmail.com>2020-07-08 19:37:24 +0100
commitd275c8bde184ca1fa71292e2f2ed5e911b731531 (patch)
tree071d7aef3c0b9dd09a71ab9ecbcf0fe408606c4b /src/animation
parentb2211f6f79b469be4d5054a2b79e3c7106d92c61 (diff)
downloadnautilus-d275c8bde184ca1fa71292e2f2ed5e911b731531.tar.gz
general: Clean up signal handler disconnection
Make use of GLib's new g_clear_signal_handler() function to simplify nautilus' signal handler disconnection and reduce unneccessary code. Fixes: #1522
Diffstat (limited to 'src/animation')
-rw-r--r--src/animation/egg-animation.c5
-rw-r--r--src/animation/ide-box-theatric.c9
2 files changed, 5 insertions, 9 deletions
diff --git a/src/animation/egg-animation.c b/src/animation/egg-animation.c
index c8b025874..7ceba88c4 100644
--- a/src/animation/egg-animation.c
+++ b/src/animation/egg-animation.c
@@ -675,9 +675,8 @@ egg_animation_stop (EggAnimation *animation)
if (animation->frame_clock)
{
gdk_frame_clock_end_updating (animation->frame_clock);
- g_signal_handler_disconnect (animation->frame_clock, animation->tween_handler);
- g_signal_handler_disconnect (animation->frame_clock, animation->after_paint_handler);
- animation->tween_handler = 0;
+ g_clear_signal_handler (&animation->tween_handler, animation->frame_clock);
+ g_clear_signal_handler (&animation->after_paint_handler, animation->frame_clock);
}
else
{
diff --git a/src/animation/ide-box-theatric.c b/src/animation/ide-box-theatric.c
index cad8d4a44..1e882eae8 100644
--- a/src/animation/ide-box-theatric.c
+++ b/src/animation/ide-box-theatric.c
@@ -40,7 +40,7 @@ struct _IdeBoxTheatric
GdkRGBA background_rgba;
gdouble alpha;
- guint draw_handler;
+ gulong draw_handler;
guint background_set : 1;
guint pixbuf_failed : 1;
@@ -194,11 +194,8 @@ ide_box_theatric_dispose (GObject *object)
if (self->target)
{
- if (self->draw_handler && self->toplevel)
- {
- g_signal_handler_disconnect (self->toplevel, self->draw_handler);
- self->draw_handler = 0;
- }
+ if (self->toplevel)
+ g_clear_signal_handler (&self->draw_handler, self->toplevel);
g_object_remove_weak_pointer (G_OBJECT (self->target),
(gpointer *) &self->target);
self->target = NULL;