From 101305e1c7dc24f5a40e80a900b0777b2634722f Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 7 Sep 2010 18:39:46 +0200 Subject: Various memory leaks --- composer/e-composer-private.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'composer') diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c index ed9e19096f..d4dcb46126 100644 --- a/composer/e-composer-private.c +++ b/composer/e-composer-private.c @@ -405,17 +405,22 @@ e_composer_private_constructed (EMsgComposer *composer) void e_composer_private_dispose (EMsgComposer *composer) { - GConfBridge *bridge; - GArray *array; - guint binding_id; - - bridge = gconf_bridge_get (); - array = composer->priv->gconf_bridge_binding_ids; + if (composer->priv->gconf_bridge_binding_ids) { + GConfBridge *bridge; + GArray *array; + guint binding_id; + + bridge = gconf_bridge_get (); + array = composer->priv->gconf_bridge_binding_ids; + + while (array->len > 0) { + binding_id = g_array_index (array, guint, 0); + gconf_bridge_unbind (bridge, binding_id); + g_array_remove_index_fast (array, 0); + } - while (array->len > 0) { - binding_id = g_array_index (array, guint, 0); - gconf_bridge_unbind (bridge, binding_id); - g_array_remove_index_fast (array, 0); + g_array_free (composer->priv->gconf_bridge_binding_ids, TRUE); + composer->priv->gconf_bridge_binding_ids = NULL; } if (composer->priv->shell != NULL) { -- cgit v1.2.3