[gnome-builder] foundry: fix unloading of pipeline addins



commit 7b51d44570495391c8ce6b6ce15d296f2eef7771
Author: Christian Hergert <chergert redhat com>
Date:   Mon Nov 29 13:33:41 2021 -0800

    foundry: fix unloading of pipeline addins
    
    Addins that were delayed during loading where not unloaded properly because
    we did not have the "HAS_LOADED" data set. Also, force destruction of them
    when the pipeline is unloaded so they are removed from the object tree.
    
    Fixes #1575

 src/libide/foundry/ide-pipeline.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/libide/foundry/ide-pipeline.c b/src/libide/foundry/ide-pipeline.c
index 7eafdcdd6..f5ce70cc4 100644
--- a/src/libide/foundry/ide-pipeline.c
+++ b/src/libide/foundry/ide-pipeline.c
@@ -1183,6 +1183,9 @@ ide_pipeline_load_cb (IdleLoadState *state)
       IdePipelineAddin *addin = g_ptr_array_index (state->addins, state->addins->len - 1);
       gint64 begin, end;
 
+      /* Keep in sync with ide_pipeline_extension_added() */
+      g_object_set_data (G_OBJECT (addin), "HAS_LOADED", GINT_TO_POINTER (1));
+
       begin = g_get_monotonic_time ();
       ide_pipeline_addin_load (addin, state->self);
       end = g_get_monotonic_time ();
@@ -1357,7 +1360,7 @@ ide_pipeline_unload (IdePipeline *self)
 
   g_assert (IDE_IS_PIPELINE (self));
 
-  g_clear_object (&self->addins);
+  ide_clear_and_destroy_object (&self->addins);
 
   IDE_EXIT;
 }


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