[gnome-software] trivial: Remove all applications from the cache when updates have changed



commit 060bfa1c5a46cef8c900bd000d9a26451a6ee0c9
Author: Richard Hughes <richard hughsie com>
Date:   Mon Sep 1 12:09:05 2014 +0100

    trivial: Remove all applications from the cache when updates have changed

 src/gs-plugin-loader.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 76869e6..af04846 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -2503,6 +2503,13 @@ static void
 gs_plugin_loader_updates_changed_cb (GsPlugin *plugin, gpointer user_data)
 {
        GsPluginLoader *plugin_loader = GS_PLUGIN_LOADER (user_data);
+
+       /* not valid anymore */
+       g_mutex_lock (&plugin_loader->priv->app_cache_mutex);
+       g_hash_table_remove_all (plugin_loader->priv->app_cache);
+       g_mutex_unlock (&plugin_loader->priv->app_cache_mutex);
+
+       /* notify shells */
        g_debug ("updates-changed");
        g_signal_emit (plugin_loader, signals[SIGNAL_UPDATES_CHANGED], 0);
 }


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