[empathy] Use _unref instead of _free _destroy when possible.unref



commit 5bb2c1c62a06e682ab48d530cae5f9614a90a75e
Author: Xavier Claessens <xclaesse gmail com>
Date:   Wed Nov 16 15:31:29 2011 +0100

    Use _unref instead of _free _destroy when possible.unref
    
    Replace g_(ptr_)array_free (foo, TRUE) and g_hash_table_destroy
    with respectively g_(ptr_)array_unref (foo) and g_hash_table_unref.
    
    I used this command to generate this patch:
    for f in `find -name "*.c"`; do sed -i $f -re 's/g_ptr_array_free \(([^ ,]+), TRUE\)/g_ptr_array_unref \(\1\)/'; done
    
    See Danielle's blog for explanation of possible bug _free can do:
    http://blogs.gnome.org/danni/2011/11/16/mistakes-with-g_value_set_boxed/

 goa-mc-plugin/mcp-account-manager-goa.c        |   10 +++++-----
 libempathy-gtk/empathy-contact-list-store.c    |    6 +++---
 libempathy-gtk/empathy-contact-search-dialog.c |    2 +-
 libempathy-gtk/empathy-contactinfo-utils.c     |    2 +-
 libempathy-gtk/empathy-individual-linker.c     |    2 +-
 libempathy-gtk/empathy-individual-menu.c       |    2 +-
 libempathy-gtk/empathy-individual-store.c      |    6 +++---
 libempathy-gtk/empathy-individual-view.c       |    2 +-
 libempathy-gtk/empathy-individual-widget.c     |    2 +-
 libempathy-gtk/empathy-notify-manager.c        |    2 +-
 libempathy-gtk/empathy-persona-store.c         |    4 ++--
 libempathy-gtk/empathy-protocol-chooser.c      |    2 +-
 libempathy-gtk/empathy-spell.c                 |    2 +-
 libempathy/empathy-account-settings.c          |    6 +++---
 libempathy/empathy-contact-manager.c           |    2 +-
 libempathy/empathy-debug.c                     |    2 +-
 libempathy/empathy-ft-handler.c                |    4 ++--
 libempathy/empathy-individual-manager.c        |    4 ++--
 libempathy/empathy-irc-network-manager.c       |    2 +-
 libempathy/empathy-tp-chat.c                   |    4 ++--
 libempathy/empathy-tp-contact-list.c           |   20 ++++++++++----------
 libempathy/empathy-tp-file.c                   |    2 +-
 libempathy/empathy-tp-roomlist.c               |    2 +-
 libempathy/empathy-tp-streamed-media.c         |    2 +-
 src/empathy-debug-window.c                     |    4 ++--
 src/empathy-ft-manager.c                       |    2 +-
 src/empathy-import-utils.c                     |    2 +-
 src/empathy-main-window.c                      |    6 +++---
 src/empathy-map-view.c                         |    2 +-
 tests/empathy-chatroom-manager-test.c          |    2 +-
 tests/empathy-tls-test.c                       |    4 ++--
 31 files changed, 58 insertions(+), 58 deletions(-)
---
diff --git a/goa-mc-plugin/mcp-account-manager-goa.c b/goa-mc-plugin/mcp-account-manager-goa.c
index 1185d7b..fd3942e 100644
--- a/goa-mc-plugin/mcp-account-manager-goa.c
+++ b/goa-mc-plugin/mcp-account-manager-goa.c
@@ -82,7 +82,7 @@ mcp_account_manager_goa_finalize (GObject *self)
 {
   McpAccountManagerGoaPrivate *priv = GET_PRIVATE (self);
 
-  g_hash_table_destroy (priv->accounts);
+  g_hash_table_unref (priv->accounts);
   g_key_file_free (priv->store);
   g_free (priv->filename);
 
@@ -150,7 +150,7 @@ get_tp_parameters (GoaAccount *account)
   else
     {
       DEBUG ("Unknown account type %s", type);
-      g_hash_table_destroy (params);
+      g_hash_table_unref (params);
       return NULL;
     }
 
@@ -179,7 +179,7 @@ get_tp_account_name (GoaAccount *account)
       (char *) g_hash_table_lookup (params, "protocol"),
       type, id);
 
-  g_hash_table_destroy (params);
+  g_hash_table_unref (params);
 
   return name;
 }
@@ -399,7 +399,7 @@ mcp_account_manager_goa_get (const McpAccountStorage *self,
       while (g_hash_table_iter_next (&iter, &key, &value))
         mcp_account_manager_set_value (am, acct, key, value);
 
-      g_hash_table_destroy (params);
+      g_hash_table_unref (params);
 
       /* Stored properties */
       keys = g_key_file_get_keys (priv->store, acct, &nkeys, NULL);
@@ -439,7 +439,7 @@ mcp_account_manager_goa_get (const McpAccountStorage *self,
 
       mcp_account_manager_set_value (am, acct, key, value);
 
-      g_hash_table_destroy (params);
+      g_hash_table_unref (params);
       g_free (value);
     }
 
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c
index ef4c466..359e6c1 100644
--- a/libempathy-gtk/empathy-contact-list-store.c
+++ b/libempathy-gtk/empathy-contact-list-store.c
@@ -386,9 +386,9 @@ contact_list_store_dispose (GObject *object)
 		priv->setup_idle_id = 0;
 	}
 
-	g_hash_table_destroy (priv->status_icons);
-	g_hash_table_destroy (priv->empathy_contact_cache);
-	g_hash_table_destroy (priv->empathy_group_cache);
+	g_hash_table_unref (priv->status_icons);
+	g_hash_table_unref (priv->empathy_contact_cache);
+	g_hash_table_unref (priv->empathy_group_cache);
 	G_OBJECT_CLASS (empathy_contact_list_store_parent_class)->dispose (object);
 }
 
diff --git a/libempathy-gtk/empathy-contact-search-dialog.c b/libempathy-gtk/empathy-contact-search-dialog.c
index 1dfb942..174f044 100644
--- a/libempathy-gtk/empathy-contact-search-dialog.c
+++ b/libempathy-gtk/empathy-contact-search-dialog.c
@@ -120,7 +120,7 @@ on_searcher_reset (GObject *source_object,
   gtk_list_store_clear (priv->store);
   tp_contact_search_start (priv->searcher, search);
 
-  g_hash_table_destroy (search);
+  g_hash_table_unref (search);
 }
 
 static void
diff --git a/libempathy-gtk/empathy-contactinfo-utils.c b/libempathy-gtk/empathy-contactinfo-utils.c
index 9d07f3f..695d1ee 100644
--- a/libempathy-gtk/empathy-contactinfo-utils.c
+++ b/libempathy-gtk/empathy-contactinfo-utils.c
@@ -206,7 +206,7 @@ build_parameters_string (GStrv parameters)
   g_ptr_array_add (output, NULL); /* NULL-terminate */
 
   join = g_strjoinv (", ", (char **) output->pdata);
-  g_ptr_array_free (output, TRUE);
+  g_ptr_array_unref (output);
 
   return join;
 }
diff --git a/libempathy-gtk/empathy-individual-linker.c b/libempathy-gtk/empathy-individual-linker.c
index 793c282..c39ed23 100644
--- a/libempathy-gtk/empathy-individual-linker.c
+++ b/libempathy-gtk/empathy-individual-linker.c
@@ -572,7 +572,7 @@ finalize (GObject *object)
 {
   EmpathyIndividualLinkerPriv *priv = GET_PRIV (object);
 
-  g_hash_table_destroy (priv->changed_individuals);
+  g_hash_table_unref (priv->changed_individuals);
 
   G_OBJECT_CLASS (empathy_individual_linker_parent_class)->finalize (object);
 }
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index 2209e15..27b2c67 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -1420,7 +1420,7 @@ empathy_individual_invite_menu_item_new (FolksIndividual *individual,
 
   gtk_widget_show (image);
 
-  g_hash_table_destroy (name_room_map);
+  g_hash_table_unref (name_room_map);
   g_object_unref (mgr);
   g_list_free (names);
   g_list_free (rooms);
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 630d8d2..da0ee87 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -1080,9 +1080,9 @@ individual_store_dispose (GObject *object)
       g_source_remove (self->priv->setup_idle_id);
     }
 
-  g_hash_table_destroy (self->priv->status_icons);
-  g_hash_table_destroy (self->priv->folks_individual_cache);
-  g_hash_table_destroy (self->priv->empathy_group_cache);
+  g_hash_table_unref (self->priv->status_icons);
+  g_hash_table_unref (self->priv->folks_individual_cache);
+  g_hash_table_unref (self->priv->empathy_group_cache);
   G_OBJECT_CLASS (empathy_individual_store_parent_class)->dispose (object);
 }
 
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 440680b..3cd1500 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -2054,7 +2054,7 @@ individual_view_finalize (GObject *object)
 
   if (priv->expand_groups_idle_handler != 0)
     g_source_remove (priv->expand_groups_idle_handler);
-  g_hash_table_destroy (priv->expand_groups);
+  g_hash_table_unref (priv->expand_groups);
 
   G_OBJECT_CLASS (empathy_individual_view_parent_class)->finalize (object);
 }
diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c
index 4883c62..08c1c1c 100644
--- a/libempathy-gtk/empathy-individual-widget.c
+++ b/libempathy-gtk/empathy-individual-widget.c
@@ -2088,7 +2088,7 @@ finalize (GObject *object)
 {
   EmpathyIndividualWidgetPriv *priv = GET_PRIV (object);
 
-  g_hash_table_destroy (priv->persona_grids);
+  g_hash_table_unref (priv->persona_grids);
 
   G_OBJECT_CLASS (empathy_individual_widget_parent_class)->finalize (object);
 }
diff --git a/libempathy-gtk/empathy-notify-manager.c b/libempathy-gtk/empathy-notify-manager.c
index 3fcf9af..bccc3e2 100644
--- a/libempathy-gtk/empathy-notify-manager.c
+++ b/libempathy-gtk/empathy-notify-manager.c
@@ -89,7 +89,7 @@ notify_manager_finalize (GObject *object)
 {
   EmpathyNotifyManagerPriv *priv = GET_PRIV (object);
 
-  g_hash_table_destroy (priv->capabilities);
+  g_hash_table_unref (priv->capabilities);
 
   G_OBJECT_CLASS (empathy_notify_manager_parent_class)->finalize (object);
 }
diff --git a/libempathy-gtk/empathy-persona-store.c b/libempathy-gtk/empathy-persona-store.c
index 70d53b3..a48fa12 100644
--- a/libempathy-gtk/empathy-persona-store.c
+++ b/libempathy-gtk/empathy-persona-store.c
@@ -898,8 +898,8 @@ finalize (GObject *object)
 {
   EmpathyPersonaStorePriv *priv = GET_PRIV (object);
 
-  g_hash_table_destroy (priv->status_icons);
-  g_hash_table_destroy (priv->personas);
+  g_hash_table_unref (priv->status_icons);
+  g_hash_table_unref (priv->personas);
 
   G_OBJECT_CLASS (empathy_persona_store_parent_class)->finalize (object);
 }
diff --git a/libempathy-gtk/empathy-protocol-chooser.c b/libempathy-gtk/empathy-protocol-chooser.c
index 46188d4..216e4ff 100644
--- a/libempathy-gtk/empathy-protocol-chooser.c
+++ b/libempathy-gtk/empathy-protocol-chooser.c
@@ -365,7 +365,7 @@ protocol_chooser_finalize (GObject *object)
 
   if (priv->protocols)
     {
-      g_hash_table_destroy (priv->protocols);
+      g_hash_table_unref (priv->protocols);
       priv->protocols = NULL;
     }
 
diff --git a/libempathy-gtk/empathy-spell.c b/libempathy-gtk/empathy-spell.c
index d097f1e..fb1441e 100644
--- a/libempathy-gtk/empathy-spell.c
+++ b/libempathy-gtk/empathy-spell.c
@@ -169,7 +169,7 @@ spell_notify_languages_cb (GSettings   *gsettings,
 
 	/* We just reset the languages list. */
 	if (languages != NULL) {
-		g_hash_table_destroy (languages);
+		g_hash_table_unref (languages);
 		languages = NULL;
 	}
 }
diff --git a/libempathy/empathy-account-settings.c b/libempathy/empathy-account-settings.c
index cd6b69e..78d6096 100644
--- a/libempathy/empathy-account-settings.c
+++ b/libempathy/empathy-account-settings.c
@@ -402,11 +402,11 @@ empathy_account_settings_finalize (GObject *object)
       g_list_free (priv->required_params);
     }
 
-  g_hash_table_destroy (priv->parameters);
-  g_hash_table_destroy (priv->param_regexps);
+  g_hash_table_unref (priv->parameters);
+  g_hash_table_unref (priv->param_regexps);
 
   empathy_account_settings_free_unset_parameters (self);
-  g_array_free (priv->unset_parameters, TRUE);
+  g_array_unref (priv->unset_parameters);
 
   G_OBJECT_CLASS (empathy_account_settings_parent_class)->finalize (object);
 }
diff --git a/libempathy/empathy-contact-manager.c b/libempathy/empathy-contact-manager.c
index 88012bf..31750dc 100644
--- a/libempathy/empathy-contact-manager.c
+++ b/libempathy/empathy-contact-manager.c
@@ -198,7 +198,7 @@ contact_manager_finalize (GObject *object)
 	g_hash_table_foreach (priv->lists,
 			      contact_manager_disconnect_foreach,
 			      object);
-	g_hash_table_destroy (priv->lists);
+	g_hash_table_unref (priv->lists);
 
 	g_object_unref (priv->account_manager);
 }
diff --git a/libempathy/empathy-debug.c b/libempathy/empathy-debug.c
index 4f624f8..9e34ac1 100644
--- a/libempathy/empathy-debug.c
+++ b/libempathy/empathy-debug.c
@@ -111,7 +111,7 @@ empathy_debug_free (void)
   if (flag_to_keys == NULL)
     return;
 
-  g_hash_table_destroy (flag_to_keys);
+  g_hash_table_unref (flag_to_keys);
   flag_to_keys = NULL;
 }
 
diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c
index facc49a..3d65252 100644
--- a/libempathy/empathy-ft-handler.c
+++ b/libempathy/empathy-ft-handler.c
@@ -1054,7 +1054,7 @@ set_content_hash_type_from_classes (EmpathyFTHandler *handler,
 
   if (!support_ft)
     {
-      g_array_free (possible_values, TRUE);
+      g_array_unref (possible_values);
       return FALSE;
     }
 
@@ -1087,7 +1087,7 @@ set_content_hash_type_from_classes (EmpathyFTHandler *handler,
     }
 
 out:
-  g_array_free (possible_values, TRUE);
+  g_array_unref (possible_values);
 
   DEBUG ("Hash enabled %s; setting content hash type as %u",
          priv->use_hash ? "True" : "False", priv->content_hash_type);
diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c
index 0446107..5305c41 100644
--- a/libempathy/empathy-individual-manager.c
+++ b/libempathy/empathy-individual-manager.c
@@ -249,7 +249,7 @@ individual_manager_dispose (GObject *object)
 {
   EmpathyIndividualManagerPriv *priv = GET_PRIV (object);
 
-  g_hash_table_destroy (priv->individuals);
+  g_hash_table_unref (priv->individuals);
 
   g_signal_handlers_disconnect_by_func (priv->aggregator,
       aggregator_individuals_changed_cb, object);
@@ -470,7 +470,7 @@ empathy_individual_manager_add_from_contact (EmpathyIndividualManager *self,
       priv->aggregator, NULL, persona_store, details,
       aggregator_add_persona_from_details_cb, contact);
 
-  g_hash_table_destroy (details);
+  g_hash_table_unref (details);
   g_object_unref (persona_store);
 
 finish:
diff --git a/libempathy/empathy-irc-network-manager.c b/libempathy/empathy-irc-network-manager.c
index 6d7ff1c..a9d89dc 100644
--- a/libempathy/empathy-irc-network-manager.c
+++ b/libempathy/empathy-irc-network-manager.c
@@ -155,7 +155,7 @@ empathy_irc_network_manager_finalize (GObject *object)
   g_free (priv->global_file);
   g_free (priv->user_file);
 
-  g_hash_table_destroy (priv->networks);
+  g_hash_table_unref (priv->networks);
 
   G_OBJECT_CLASS (empathy_irc_network_manager_parent_class)->finalize (object);
 }
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 087090a..d34f581 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -762,7 +762,7 @@ tp_chat_finalize (GObject *object)
 
 	g_queue_free (self->priv->messages_queue);
 	g_queue_free (self->priv->pending_messages_queue);
-	g_hash_table_destroy (self->priv->messages_being_sent);
+	g_hash_table_unref (self->priv->messages_being_sent);
 
 	g_free (self->priv->title);
 	g_free (self->priv->subject);
@@ -1441,7 +1441,7 @@ empathy_tp_chat_join (EmpathyTpChat *self)
 	tp_cli_channel_interface_group_call_add_members ((TpChannel *) self, -1, members,
 		"", add_members_cb, NULL, NULL, G_OBJECT (self));
 
-	g_array_free (members, TRUE);
+	g_array_unref (members);
 }
 
 gboolean
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index bf639e4..0551545 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -273,7 +273,7 @@ tp_contact_list_group_ready_cb (TpChannel *channel,
 	g_assert (members != NULL);
 	arr = tp_intset_to_array (members);
 	contacts_added_to_group (list, channel, arr);
-	g_array_free (arr, TRUE);
+	g_array_unref (arr);
 }
 
 static void
@@ -354,7 +354,7 @@ tp_contact_list_group_add (EmpathyTpContactList *list,
 	if (channel) {
 		tp_cli_channel_interface_group_call_add_members (channel, -1,
 			handles, NULL, NULL, NULL, NULL, NULL);
-		g_array_free (handles, TRUE);
+		g_array_unref (handles);
 		return;
 	}
 
@@ -434,7 +434,7 @@ add_to_members (EmpathyTpContactList *list,
 				got_added_members_cb, NULL, NULL, G_OBJECT (list));
 	}
 
-	g_array_free (request, TRUE);
+	g_array_unref (request);
 }
 
 static void
@@ -684,7 +684,7 @@ tp_contact_list_subscribe_group_members_changed_cb (TpChannel     *channel,
 	tp_cli_channel_interface_group_call_add_members (priv->publish,
 		-1, accept, NULL, NULL, NULL, NULL, NULL);
 
-	g_array_free (accept, TRUE);
+	g_array_unref (accept);
 }
 
 static void
@@ -740,10 +740,10 @@ tp_contact_list_finalize (GObject *object)
 			tp_contact_list_group_invalidated_cb, list);
 	}
 
-	g_hash_table_destroy (priv->groups);
-	g_hash_table_destroy (priv->members);
-	g_hash_table_destroy (priv->pendings);
-	g_hash_table_destroy (priv->add_to_group);
+	g_hash_table_unref (priv->groups);
+	g_hash_table_unref (priv->members);
+	g_hash_table_unref (priv->pendings);
+	g_hash_table_unref (priv->add_to_group);
 
 	G_OBJECT_CLASS (empathy_tp_contact_list_parent_class)->finalize (object);
 }
@@ -1016,7 +1016,7 @@ empathy_tp_contact_list_class_init (EmpathyTpContactListClass *klass)
 static void
 tp_contact_list_array_free (gpointer handles)
 {
-	g_array_free (handles, TRUE);
+	g_array_unref (handles);
 }
 
 static void
@@ -1281,7 +1281,7 @@ tp_contact_list_remove_group (EmpathyContactList *list,
 	tp_cli_channel_interface_group_call_remove_members (channel, -1,
 		handles, NULL, NULL, NULL, NULL, NULL);
 	tp_cli_channel_call_close (channel, -1, NULL, NULL, NULL, NULL);
-	g_array_free (handles, TRUE);
+	g_array_unref (handles);
 }
 
 static EmpathyContactListFlags
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c
index ff2099e..c5c9f0c 100644
--- a/libempathy/empathy-tp-file.c
+++ b/libempathy/empathy-tp-file.c
@@ -705,7 +705,7 @@ do_finalize (GObject *object)
 
   if (self->priv->socket_address != NULL)
     {
-      g_array_free (self->priv->socket_address, TRUE);
+      g_array_unref (self->priv->socket_address);
       self->priv->socket_address = NULL;
     }
 
diff --git a/libempathy/empathy-tp-roomlist.c b/libempathy/empathy-tp-roomlist.c
index 1e53fac..93e28d3 100644
--- a/libempathy/empathy-tp-roomlist.c
+++ b/libempathy/empathy-tp-roomlist.c
@@ -203,7 +203,7 @@ tp_roomlist_got_rooms_cb (TpChannel       *channel,
 						       chatrooms,
 						       tp_roomlist_chatrooms_free,
 						       list);
-		g_array_free (handles, TRUE);
+		g_array_unref (handles);
 	}
 }
 
diff --git a/libempathy/empathy-tp-streamed-media.c b/libempathy/empathy-tp-streamed-media.c
index 87ca01d..388b3aa 100644
--- a/libempathy/empathy-tp-streamed-media.c
+++ b/libempathy/empathy-tp-streamed-media.c
@@ -261,7 +261,7 @@ tp_streamed_media_request_streams_for_capabilities (EmpathyTpStreamedMedia *call
       handle, stream_types, tp_streamed_media_request_streams_cb, NULL, NULL,
       G_OBJECT (call));
 
-  g_array_free (stream_types, TRUE);
+  g_array_unref (stream_types);
 }
 
 static void
diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c
index 294c6af..80dad10 100644
--- a/src/empathy-debug-window.c
+++ b/src/empathy-debug-window.c
@@ -631,7 +631,7 @@ get_cm_display_name (EmpathyDebugWindow *self,
       retval = g_strdup (cm_name);
     }
 
-  g_hash_table_destroy (protocols);
+  g_hash_table_unref (protocols);
 
   return retval;
 }
@@ -1721,7 +1721,7 @@ debug_window_finalize (GObject *object)
       debug_message_list_free (values);
     }
 
-  g_hash_table_destroy (priv->cache);
+  g_hash_table_unref (priv->cache);
 
   (G_OBJECT_CLASS (empathy_debug_window_parent_class)->finalize) (object);
 }
diff --git a/src/empathy-ft-manager.c b/src/empathy-ft-manager.c
index 5d2f659..606600e 100644
--- a/src/empathy-ft-manager.c
+++ b/src/empathy-ft-manager.c
@@ -1082,7 +1082,7 @@ empathy_ft_manager_finalize (GObject *object)
 
   DEBUG ("FT Manager %p", object);
 
-  g_hash_table_destroy (priv->ft_handler_to_row_ref);
+  g_hash_table_unref (priv->ft_handler_to_row_ref);
 
   G_OBJECT_CLASS (empathy_ft_manager_parent_class)->finalize (object);
 }
diff --git a/src/empathy-import-utils.c b/src/empathy-import-utils.c
index bf7f29e..0c878e8 100644
--- a/src/empathy-import-utils.c
+++ b/src/empathy-import-utils.c
@@ -55,7 +55,7 @@ empathy_import_account_data_free (EmpathyImportAccountData *data)
   if (data->connection_manager != NULL)
     g_free (data->connection_manager);
   if (data->settings != NULL)
-    g_hash_table_destroy (data->settings);
+    g_hash_table_unref (data->settings);
   if (data->source != NULL)
     g_free (data->source);
 
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 367ae06..0e4b8ba 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -1372,8 +1372,8 @@ empathy_main_window_finalize (GObject *window)
 	g_object_unref (priv->individual_store);
 	g_object_unref (priv->contact_manager);
 	g_object_unref (priv->sound_mgr);
-	g_hash_table_destroy (priv->errors);
-	g_hash_table_destroy (priv->auths);
+	g_hash_table_unref (priv->errors);
+	g_hash_table_unref (priv->auths);
 
 	/* disconnect all handlers of status-changed signal */
 	g_hash_table_iter_init (&iter, priv->status_changed_handlers);
@@ -1381,7 +1381,7 @@ empathy_main_window_finalize (GObject *window)
 		g_signal_handler_disconnect (TP_ACCOUNT (key),
 					     GPOINTER_TO_UINT (value));
 
-	g_hash_table_destroy (priv->status_changed_handlers);
+	g_hash_table_unref (priv->status_changed_handlers);
 
 	g_signal_handlers_disconnect_by_func (priv->event_manager,
 			  		      main_window_event_added_cb,
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c
index 9e6cc6d..72aab0b 100644
--- a/src/empathy-map-view.c
+++ b/src/empathy-map-view.c
@@ -412,7 +412,7 @@ empathy_map_view_finalize (GObject *object)
   g_signal_handler_disconnect (priv->contact_list,
       priv->members_changed_id);
 
-  g_hash_table_destroy (priv->markers);
+  g_hash_table_unref (priv->markers);
   g_object_unref (priv->contact_list);
   g_object_unref (priv->layer);
 
diff --git a/tests/empathy-chatroom-manager-test.c b/tests/empathy-chatroom-manager-test.c
index 966027f..3ba0239 100644
--- a/tests/empathy-chatroom-manager-test.c
+++ b/tests/empathy-chatroom-manager-test.c
@@ -76,7 +76,7 @@ check_chatrooms_list (EmpathyChatroomManager *mgr,
   fail_if (g_hash_table_size (found) != 0);
 
   g_list_free (chatrooms);
-  g_hash_table_destroy (found);
+  g_hash_table_unref (found);
 }
 
 static gboolean
diff --git a/tests/empathy-tls-test.c b/tests/empathy-tls-test.c
index f2b667d..8256da4 100644
--- a/tests/empathy-tls-test.c
+++ b/tests/empathy-tls-test.c
@@ -102,7 +102,7 @@ mock_tls_certificate_finalize (GObject *object)
       &self->rejections);
   g_free (self->cert_type);
   self->cert_type = NULL;
-  g_ptr_array_free (self->cert_data, TRUE);
+  g_ptr_array_unref (self->cert_data);
   self->cert_data = NULL;
 
   G_OBJECT_CLASS (mock_tls_certificate_parent_class)->finalize (object);
@@ -226,7 +226,7 @@ mock_tls_certificate_assert_rejected (MockTLSCertificate *self,
               TP_HASH_TYPE_STRING_VARIANT_MAP, &rejection_details,
               NULL);
       g_free (rejection_error);
-      g_hash_table_destroy (rejection_details);
+      g_hash_table_unref (rejection_details);
 
       if (rejection_reason == reason)
         return;



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