summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Lunn <tim@feathertop.org>2016-01-13 18:38:55 +1100
committerTim Lunn <tim@feathertop.org>2016-01-15 21:03:01 +1100
commit78cf2dd5158049174e61fddff3130542032553d5 (patch)
tree9ac705cd2d53350fd1e075d37feb7c241d8510c0
parent18fb1cd65b7afbf0892ce538e85d9950fb545437 (diff)
lua-factory: avoid double free of GOA data
This fixes test suite failure under Ubuntu buildd's where there is not running X session, so goa_client_new_finish() fails with an error. https://bugzilla.gnome.org/show_bug.cgi?id=760565
-rw-r--r--src/lua-factory/grl-lua-factory.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lua-factory/grl-lua-factory.c b/src/lua-factory/grl-lua-factory.c
index 0ee136b..5b531da 100644
--- a/src/lua-factory/grl-lua-factory.c
+++ b/src/lua-factory/grl-lua-factory.c
@@ -185,9 +185,6 @@ grl_lua_factory_plugin_init (GrlRegistry *registry,
GError *err = NULL;
gboolean source_loaded = FALSE;
GCancellable *cancellable;
-#ifdef GOA_ENABLED
- GList *lua_init_sources = NULL;
-#endif
GRL_LOG_DOMAIN_INIT (lua_factory_log_domain, "lua-factory");
@@ -220,11 +217,9 @@ grl_lua_factory_plugin_init (GrlRegistry *registry,
goa_client_new (cancellable, grl_lua_factory_goa_init, goa_data);
- lua_init_sources = g_list_prepend (lua_init_sources, goa_data);
}
g_list_free (goa_sources);
- g_object_set_data (G_OBJECT (plugin), "lua-init-sources", lua_init_sources);
#else
g_assert (goa_sources == NULL);
#endif
@@ -782,6 +777,7 @@ grl_lua_goa_data_free (GrlLuaGoaData *data)
g_free (data->account_provider);
g_free (data->account_feature);
g_clear_pointer (&data->sources, g_hash_table_destroy);
+ g_free (data);
}
static void
@@ -793,6 +789,7 @@ grl_lua_factory_goa_init (GObject *source_object,
GList *tmp;
GList *acc_list;
GList *lua_acc_list = NULL;
+ GList *lua_init_sources = NULL;
GrlLuaGoaData *lua_data = user_data;
GoaClient *client;
@@ -806,6 +803,10 @@ grl_lua_factory_goa_init (GObject *source_object,
return;
}
+ lua_init_sources = g_object_get_data (G_OBJECT (lua_data->plugin), "lua-init-sources");
+ lua_init_sources = g_list_prepend (lua_init_sources, lua_data);
+ g_object_set_data (G_OBJECT (lua_data->plugin), "lua-init-sources", lua_init_sources);
+
lua_data->client = client;
acc_list = goa_client_get_accounts (client);