[gnome-software/mwleeds/hardcoded-pwa-list] fixup! epiphany: Refine appstream-provided web apps



commit 546b899dd51cf53cb9ce88b7de435ed8ec1416db
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Mon May 16 14:06:44 2022 -0700

    fixup! epiphany: Refine appstream-provided web apps

 plugins/epiphany/gs-plugin-epiphany.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/plugins/epiphany/gs-plugin-epiphany.c b/plugins/epiphany/gs-plugin-epiphany.c
index c04ef36d8..4a2812f02 100644
--- a/plugins/epiphany/gs-plugin-epiphany.c
+++ b/plugins/epiphany/gs-plugin-epiphany.c
@@ -975,8 +975,12 @@ gs_plugin_app_install (GsPlugin      *plugin,
                return FALSE;
        }
 
-       g_hash_table_insert (self->url_id_map, g_strdup (url),
-                            g_strdup (installed_desktop_id));
+       {
+               g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&self->installed_apps_mutex);
+               g_hash_table_insert (self->url_id_map, g_strdup (url),
+                                    g_strdup (installed_desktop_id));
+       }
+
        gs_app_set_launchable (app, AS_LAUNCHABLE_KIND_DESKTOP_ID, installed_desktop_id);
        gs_app_set_state (app, GS_APP_STATE_INSTALLED);
 
@@ -1017,8 +1021,10 @@ gs_plugin_app_remove (GsPlugin      *plugin,
        }
 
        url = gs_app_get_launchable (app, AS_LAUNCHABLE_KIND_URL);
-       if (url != NULL && *url != '\0')
+       if (url != NULL && *url != '\0') {
+               g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&self->installed_apps_mutex);
                g_hash_table_remove (self->url_id_map, url);
+       }
 
        /* The app is not necessarily available; it may have been installed
         * directly in Epiphany


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