[gnome-builder] xdg-app: cleanup runtimes when plugin is unloaded



commit e26fb1882c5dd591f5da4374aaa5b63a2281b251
Author: Christian Hergert <chergert redhat com>
Date:   Wed Feb 17 15:37:22 2016 -0800

    xdg-app: cleanup runtimes when plugin is unloaded

 plugins/xdg-app/gbp-xdg-runtime-provider.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/plugins/xdg-app/gbp-xdg-runtime-provider.c b/plugins/xdg-app/gbp-xdg-runtime-provider.c
index 3746c75..72da3e3 100644
--- a/plugins/xdg-app/gbp-xdg-runtime-provider.c
+++ b/plugins/xdg-app/gbp-xdg-runtime-provider.c
@@ -225,11 +225,25 @@ gbp_xdg_runtime_provider_unload (IdeRuntimeProvider *provider,
   g_assert (GBP_IS_XDG_RUNTIME_PROVIDER (self));
   g_assert (IDE_IS_RUNTIME_MANAGER (manager));
 
+  if (self->runtimes != NULL)
+    {
+      for (guint i= 0; i < self->runtimes->len; i++)
+        {
+          IdeRuntime *runtime = g_ptr_array_index (self->runtimes, i);
+
+          ide_runtime_manager_remove (manager, runtime);
+        }
+    }
+
+  g_clear_pointer (&self->runtimes, g_ptr_array_unref);
+
   if (self->cancellable != NULL)
     g_cancellable_cancel (self->cancellable);
+  g_clear_object (&self->cancellable);
+
+  g_clear_object (&self->installation);
 
   ide_clear_weak_pointer (&self->manager);
-  g_clear_object (&self->cancellable);
 }
 
 static void


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