[gnome-builder/wip/chergert/gnome-builder-flatpak: 10/14] flatpak: reuse FlatpakInstallation



commit c6fecde3a9038a7c3637335eb799f8619bdb7aa4
Author: Christian Hergert <chergert redhat com>
Date:   Wed Apr 10 23:23:06 2019 -0700

    flatpak: reuse FlatpakInstallation
    
    The FlatpakInstallation object is thread-safe, so we can just ref it and
    pass it to a thread.

 src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
---
diff --git a/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c 
b/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c
index 7b1efc3af..94ade76e9 100644
--- a/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c
+++ b/src/plugins/flatpak/daemon/ipc-flatpak-service-impl.c
@@ -80,15 +80,6 @@ static void      runtime_free                                (Runtime
 static gboolean  runtime_equal                               (const Runtime          *a,
                                                               const Runtime          *b);
 static void      is_known_free                               (IsKnown                *state);
-static FlatpakInstallation *installation_copy                (FlatpakInstallation    *installation);
-
-static FlatpakInstallation *
-installation_copy (FlatpakInstallation *installation)
-{
-  return flatpak_installation_new_for_path (flatpak_installation_get_path (installation),
-                                            flatpak_installation_get_is_user (installation),
-                                            NULL, NULL);
-}
 
 static void
 is_known_free (IsKnown *state)
@@ -450,7 +441,7 @@ ipc_flatpak_service_impl_runtime_is_known (IpcFlatpakService     *service,
   /* Now check remote refs */
   g_hash_table_iter_init (&iter, self->installs);
   while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&install))
-    g_ptr_array_add (state->installs, installation_copy (install->installation));
+    g_ptr_array_add (state->installs, g_object_ref (install->installation));
 
   g_task_run_in_thread (task, is_known_worker);
 


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