[gnome-builder] buffer: clean up diagnostics asignment



commit 4f531ab0a313a1f34115601ffebd6f9fb25a538d
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 12 17:45:39 2016 +0300

    buffer: clean up diagnostics asignment

 libide/ide-buffer.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/libide/ide-buffer.c b/libide/ide-buffer.c
index ed59a48..ca90f06 100644
--- a/libide/ide-buffer.c
+++ b/libide/ide-buffer.c
@@ -486,13 +486,15 @@ ide_buffer_set_diagnostics (IdeBuffer      *self,
 
   if (diagnostics != priv->diagnostics)
     {
-      g_clear_pointer (&priv->diagnostics, ide_diagnostics_unref);
-      priv->diagnostics = diagnostics ? ide_diagnostics_ref (diagnostics) : NULL;
-
       ide_buffer_clear_diagnostics (self);
 
-      if (diagnostics)
-        ide_buffer_update_diagnostics (self, diagnostics);
+      g_clear_pointer (&priv->diagnostics, ide_diagnostics_unref);
+
+      if (diagnostics != NULL)
+        {
+          priv->diagnostics = ide_diagnostics_ref (diagnostics);
+          ide_buffer_update_diagnostics (self, diagnostics);
+        }
 
       g_signal_emit (self, signals [LINE_FLAGS_CHANGED], 0);
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_HAS_DIAGNOSTICS]);


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