[gnome-software/gnome-3-22] trivial: Do not create a GsApp when emitting global status
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-22] trivial: Do not create a GsApp when emitting global status
- Date: Tue, 7 Mar 2017 16:33:39 +0000 (UTC)
commit cb2c0d00651ac451739f1aa346bec2ecb651d53c
Author: Richard Hughes <richard hughsie com>
Date: Wed Feb 22 19:48:17 2017 +0000
trivial: Do not create a GsApp when emitting global status
src/gs-plugin-loader.c | 2 +-
src/gs-plugin.c | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 1b6b961..e0ceffe 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -3481,7 +3481,7 @@ gs_plugin_loader_status_changed_cb (GsPlugin *plugin,
GsPluginLoaderPrivate *priv = gs_plugin_loader_get_instance_private (plugin_loader);
/* nothing specific */
- if (gs_app_get_id (app) == NULL) {
+ if (app == NULL || gs_app_get_id (app) == NULL) {
if (priv->global_status_last != status) {
g_debug ("emitting global %s",
gs_plugin_status_to_string (status));
diff --git a/src/gs-plugin.c b/src/gs-plugin.c
index 5efbbb4..daa591b 100644
--- a/src/gs-plugin.c
+++ b/src/gs-plugin.c
@@ -859,7 +859,8 @@ gs_plugin_status_update_cb (gpointer user_data)
signals[SIGNAL_STATUS_CHANGED], 0,
helper->app,
helper->status);
- g_object_unref (helper->app);
+ if (helper->app != NULL)
+ g_object_unref (helper->app);
g_slice_free (GsPluginStatusHelper, helper);
return FALSE;
}
@@ -881,9 +882,7 @@ gs_plugin_status_update (GsPlugin *plugin, GsApp *app, GsPluginStatus status)
helper = g_slice_new0 (GsPluginStatusHelper);
helper->plugin = plugin;
helper->status = status;
- if (app == NULL)
- helper->app = gs_app_new (NULL);
- else
+ if (app != NULL)
helper->app = g_object_ref (app);
g_idle_add (gs_plugin_status_update_cb, helper);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]