diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 22:31:29 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 22:57:00 +0800 |
commit | 5bb2c1c62a06e682ab48d530cae5f9614a90a75e (patch) | |
tree | a847e5c1980d69126b8d7974808cb70923becb33 /libempathy-gtk | |
parent | ba6e07cc5a0bf75118c12fd5ebf05e4453a5dc80 (diff) | |
download | gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar.gz gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar.bz2 gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar.lz gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar.xz gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.tar.zst gsoc2013-empathy-5bb2c1c62a06e682ab48d530cae5f9614a90a75e.zip |
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/
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-contact-list-store.c | 6 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-search-dialog.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contactinfo-utils.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-linker.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-menu.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-store.c | 6 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-widget.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-notify-manager.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-persona-store.c | 4 | ||||
-rw-r--r-- | libempathy-gtk/empathy-protocol-chooser.c | 2 | ||||
-rw-r--r-- | libempathy-gtk/empathy-spell.c | 2 |
12 files changed, 17 insertions, 17 deletions
diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c index ef4c466b3..359e6c1b6 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 1dfb942e2..174f0441d 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 9d07f3fa1..695d1ee3c 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 793c2827f..c39ed2309 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 2209e1538..27b2c67c2 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 630d8d284..da0ee871f 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 440680b20..3cd1500a8 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 4883c62e7..08c1c1c6b 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 3fcf9afb7..bccc3e21e 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 70d53b3c1..a48fa121e 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 46188d499..216e4ffdb 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 d097f1eeb..fb1441e6f 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; } } |