[gnome-builder] sourceview: use g_clear_handle_id() to remove source



commit 1b3577b4559925696f612942f49a01c2ba79d46c
Author: Christian Hergert <chergert redhat com>
Date:   Sun Feb 24 14:56:19 2019 -0800

    sourceview: use g_clear_handle_id() to remove source

 src/libide/sourceview/ide-source-view.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/libide/sourceview/ide-source-view.c b/src/libide/sourceview/ide-source-view.c
index 62c8d9255..d37e73f5a 100644
--- a/src/libide/sourceview/ide-source-view.c
+++ b/src/libide/sourceview/ide-source-view.c
@@ -4003,7 +4003,7 @@ ide_source_view_focus_in_event (GtkWidget     *widget,
   /* Force size allocation immediately if we have something queued. */
   if (priv->delay_size_allocate_chainup)
     {
-      g_source_remove (priv->delay_size_allocate_chainup);
+      g_clear_handle_id (&priv->delay_size_allocate_chainup, g_source_remove);
       ide_source_view_do_size_allocate_hack_cb (self);
     }
 
@@ -4625,8 +4625,7 @@ ide_source_view_do_size_allocate_hack (IdeSourceView *self,
    * If we are animating at 60 FPS, we should get another size-allocate within
    * the frame cycle, typically 17 msec.
    */
-  if (priv->delay_size_allocate_chainup)
-    g_source_remove (priv->delay_size_allocate_chainup);
+  g_clear_handle_id (&priv->delay_size_allocate_chainup, g_source_remove);
   priv->delay_size_allocate_chainup = g_timeout_add (30,
                                                      ide_source_view_do_size_allocate_hack_cb,
                                                      self);
@@ -5311,11 +5310,7 @@ ide_source_view_dispose (GObject *object)
 
   ide_source_view_clear_snippets (self);
 
-  if (priv->delay_size_allocate_chainup)
-    {
-      g_source_remove (priv->delay_size_allocate_chainup);
-      priv->delay_size_allocate_chainup = 0;
-    }
+  g_clear_handle_id (&priv->delay_size_allocate_chainup, g_source_remove);
 
   g_clear_object (&priv->hover);
   g_clear_object (&priv->completion);


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