diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 14:39:30 +0100 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 15:56:47 +0100 |
commit | 769a97c2ed9e6cbfda656a65483f6142423adc36 (patch) | |
tree | 2fd5a84dd6c4a41d4e4e61d37780d65a630fa72f /src/disco.c | |
parent | dfccd984ac6c694a689c1f224efb4f4e2b27e01c (diff) |
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 'src/disco.c')
-rw-r--r-- | src/disco.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/disco.c b/src/disco.c index 21a15423b..cc3c3b6f8 100644 --- a/src/disco.c +++ b/src/disco.c @@ -237,7 +237,7 @@ gabble_disco_dispose (GObject *object) g_free ((char *) item->name); g_free ((char *) item->category); g_free ((char *) item->type); - g_hash_table_destroy (item->features); + g_hash_table_unref (item->features); g_free (item); } @@ -662,7 +662,7 @@ item_info_cb (GabbleDisco *disco, item.features = keys; pipeline->callback (pipeline, &item, pipeline->user_data); - g_hash_table_destroy (keys); + g_hash_table_unref (keys); done: gabble_disco_fill_pipeline (disco, pipeline); @@ -847,8 +847,8 @@ gabble_disco_pipeline_destroy (gpointer self) gabble_disco_cancel_request (pipeline->disco, request); } - g_hash_table_destroy (pipeline->remaining_items); - g_ptr_array_free (pipeline->disco_pipeline, TRUE); + g_hash_table_unref (pipeline->remaining_items); + g_ptr_array_unref (pipeline->disco_pipeline); g_free (pipeline); } |