[gnome-software/gnome-3-14] appstream plugin: Add locking to one more place



commit 674e32e9e3355de17080a12e1774f5c2bf79c720
Author: Kalev Lember <kalevlember gmail com>
Date:   Sat Jun 6 22:55:20 2015 +0200

    appstream plugin: Add locking to one more place
    
    Missed it in the previous commit.

 src/plugins/gs-plugin-appstream.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index fedc2f7..280e013 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -197,6 +197,8 @@ gs_plugin_startup (GsPlugin *plugin, GError **error)
        guint *perc;
 #endif
 
+       g_mutex_lock (&plugin->priv->store_mutex);
+
        /* clear all existing applications if the store was invalidated */
        as_store_remove_all (plugin->priv->store);
 
@@ -265,6 +267,7 @@ out:
        if (origins != NULL)
                g_hash_table_unref (origins);
 #endif
+       g_mutex_unlock (&plugin->priv->store_mutex);
        gs_profile_stop (plugin->profile, "appstream::startup");
        return ret;
 }


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