[gnome-builder] diagnostics: clear diagnostics group



commit 99d19f42f0fd7eec43df98faffaa19ee4973e414
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 3 01:19:05 2018 -0800

    diagnostics: clear diagnostics group
    
    We don't want to let the object hold onto the group after
    the extension has been dropped.
    
    Signed-off-by: Christian Hergert <chergert redhat com>

 src/libide/diagnostics/ide-diagnostics-manager.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/diagnostics/ide-diagnostics-manager.c 
b/src/libide/diagnostics/ide-diagnostics-manager.c
index 32fe1a9..a3558b2 100644
--- a/src/libide/diagnostics/ide-diagnostics-manager.c
+++ b/src/libide/diagnostics/ide-diagnostics-manager.c
@@ -166,8 +166,7 @@ free_diagnostics (gpointer data)
 {
   IdeDiagnostics *diagnostics = data;
 
-  if (diagnostics != NULL)
-    ide_diagnostics_unref (diagnostics);
+  g_clear_pointer (&diagnostics, ide_diagnostics_unref);
 }
 
 static void
@@ -824,6 +823,9 @@ ide_diagnostics_manager_extension_removed (IdeExtensionSetAdapter *adapter,
    */
   ide_diagnostics_manager_clear_by_provider (self, provider);
 
+  /* Clear the diagnostics group */
+  g_object_set_data (G_OBJECT (provider), "IDE_DIAGNOSTICS_GROUP", NULL);
+
   IDE_EXIT;
 }
 


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