[gnome-software/gnome-3-10] Fix a refcounting error
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/gnome-3-10] Fix a refcounting error
- Date: Wed, 9 Oct 2013 08:17:52 +0000 (UTC)
commit f600d2d245b56e00608e37d9acda023cce2f3034
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Oct 6 13:31:14 2013 -0400
Fix a refcounting error
pending_apps has g_object_unref as free func, which means
g_ptr_array_remove will drop a reference. That won't end well
unless you take a reference when adding apps to the array.
https://bugzilla.gnome.org/show_bug.cgi?id=709306
src/gs-plugin-loader.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gs-plugin-loader.c b/src/gs-plugin-loader.c
index 694dbab..11b9ba8 100644
--- a/src/gs-plugin-loader.c
+++ b/src/gs-plugin-loader.c
@@ -1615,7 +1615,7 @@ gs_plugin_loader_thread_func (gpointer user_data)
/* add to list */
gs_app_set_state (helper->app, helper->state_progress);
g_mutex_lock (&helper->plugin_loader->priv->pending_apps_mutex);
- g_ptr_array_add (helper->plugin_loader->priv->pending_apps, helper->app);
+ g_ptr_array_add (helper->plugin_loader->priv->pending_apps, g_object_ref (helper->app));
g_mutex_unlock (&helper->plugin_loader->priv->pending_apps_mutex);
g_idle_add (emit_pending_apps_idle, g_object_ref (helper->plugin_loader));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]