[gnome-software] snap: Only refine screenshots when requested



commit 3e84eb513be6a4b84ab25ad30af9562d6302da5c
Author: Robert Ancell <robert ancell canonical com>
Date:   Wed Mar 14 16:25:45 2018 +1300

    snap: Only refine screenshots when requested
    
    The screenshot code is not thread safe so multiple refines running
    could collide. This can occur when populating featured apps and
    browsing at the same time.

 plugins/snap/gs-plugin-snap.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/plugins/snap/gs-plugin-snap.c b/plugins/snap/gs-plugin-snap.c
index 399a5b75..96cde622 100644
--- a/plugins/snap/gs-plugin-snap.c
+++ b/plugins/snap/gs-plugin-snap.c
@@ -792,15 +792,14 @@ gs_plugin_refine_app (GsPlugin *plugin,
 
        /* add information specific to store snaps */
        if (store_snap != NULL) {
-               GPtrArray *screenshots;
-
                gs_app_set_origin (app, priv->store_name);
                gs_app_set_size_download (app, snapd_snap_get_download_size (store_snap));
 
-               screenshots = snapd_snap_get_screenshots (store_snap);
-               if (screenshots != NULL && gs_app_get_screenshots (app)->len == 0) {
+               if (flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_SCREENSHOTS && gs_app_get_screenshots (app)->len 
== 0) {
+                       GPtrArray *screenshots;
                        guint i;
 
+                       screenshots = snapd_snap_get_screenshots (store_snap);
                        for (i = 0; i < screenshots->len; i++) {
                                SnapdScreenshot *screenshot = screenshots->pdata[i];
                                const gchar *url;


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