diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 14:08:45 +0100 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2011-11-16 14:36:51 +0100 |
commit | 67bffca0678d1286d07b1531f6562126e92cc31e (patch) | |
tree | 309fa93328b63d8c1a90432bc1c697b4a97beba0 | |
parent | e6d8b4c7531688cd2dbd3c9bbd8a6c224123de05 (diff) |
Use _unref instead of _free _destroy when possible.
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/
84 files changed, 299 insertions, 299 deletions
diff --git a/examples/client/extended-client.c b/examples/client/extended-client.c index bf01b8777..678cbc6dc 100644 --- a/examples/client/extended-client.c +++ b/examples/client/extended-client.c @@ -162,7 +162,7 @@ contacts_ready_cb (TpConnection *conn, "red", EXAMPLE_HAT_STYLE_FEDORA, asv, set_hat_cb, pair, contact_pair_free, NULL); - g_hash_table_destroy (asv); + g_hash_table_unref (asv); } static void @@ -272,7 +272,7 @@ connection_manager_got_info (TpConnectionManager *cm, tp_cli_connection_manager_call_request_connection (cm, -1, "example", params, cm_requested_connection, NULL, NULL, NULL); - g_hash_table_destroy (params); + g_hash_table_unref (params); } } diff --git a/examples/cm/callable/conn.c b/examples/cm/callable/conn.c index 86cbdc19a..38b13c4ab 100644 --- a/examples/cm/callable/conn.c +++ b/examples/cm/callable/conn.c @@ -280,7 +280,7 @@ get_contact_statuses (GObject *object, g_hash_table_insert (result, GUINT_TO_POINTER (contact), tp_presence_status_new (presence, parameters)); - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); } return result; @@ -335,7 +335,7 @@ set_own_status (GObject *object, g_hash_table_insert (presences, GUINT_TO_POINTER (base->self_handle), (gpointer) status); tp_presence_mixin_emit_presence_update (object, presences); - g_hash_table_destroy (presences); + g_hash_table_unref (presences); if (!self->priv->away) { diff --git a/examples/cm/callable/media-channel.c b/examples/cm/callable/media-channel.c index 29dbe53a3..99b01ca9b 100644 --- a/examples/cm/callable/media-channel.c +++ b/examples/cm/callable/media-channel.c @@ -355,7 +355,7 @@ dispose (GObject *object) self->priv->disposed = TRUE; - g_hash_table_destroy (self->priv->streams); + g_hash_table_unref (self->priv->streams); self->priv->streams = NULL; example_callable_media_channel_close (self, self->group.self_handle, @@ -548,7 +548,7 @@ media_list_streams (TpSvcChannelTypeStreamedMedia *iface, tp_svc_channel_type_streamed_media_return_from_list_streams (context, array); g_ptr_array_foreach (array, (GFunc) g_value_array_free, NULL); - g_ptr_array_free (array, TRUE); + g_ptr_array_unref (array); } static void diff --git a/examples/cm/callable/media-manager.c b/examples/cm/callable/media-manager.c index ed1bb8133..a1af8dd2b 100644 --- a/examples/cm/callable/media-manager.c +++ b/examples/cm/callable/media-manager.c @@ -370,7 +370,7 @@ example_callable_media_manager_type_foreach_channel_class (GType type, func (type, table, allowed_properties, user_data); - g_hash_table_destroy (table); + g_hash_table_unref (table); } static gboolean diff --git a/examples/cm/channelspecific/room-manager.c b/examples/cm/channelspecific/room-manager.c index 1128a5584..4eac0923f 100644 --- a/examples/cm/channelspecific/room-manager.c +++ b/examples/cm/channelspecific/room-manager.c @@ -178,7 +178,7 @@ example_csh_room_manager_close_all (ExampleCSHRoomManager *self) GHashTable *tmp = self->priv->channels; self->priv->channels = NULL; - g_hash_table_destroy (tmp); + g_hash_table_unref (tmp); } if (self->priv->status_changed_id != 0) @@ -284,7 +284,7 @@ example_csh_room_manager_type_foreach_channel_class (GType type, func (type, table, allowed_properties, user_data); - g_hash_table_destroy (table); + g_hash_table_unref (table); } static gboolean diff --git a/examples/cm/contactlist/conn.c b/examples/cm/contactlist/conn.c index 354e7fd5a..bd5ddfd58 100644 --- a/examples/cm/contactlist/conn.c +++ b/examples/cm/contactlist/conn.c @@ -177,7 +177,7 @@ alias_updated_cb (ExampleContactList *contact_list, tp_svc_connection_interface_aliasing_emit_aliases_changed (self, aliases); - g_ptr_array_free (aliases, TRUE); + g_ptr_array_unref (aliases); g_value_array_free (pair); } @@ -350,7 +350,7 @@ get_contact_statuses (GObject *object, g_str_equal, NULL, (GDestroyNotify) tp_g_value_slice_free); g_hash_table_insert (result, GUINT_TO_POINTER (contact), tp_presence_status_new (presence, parameters)); - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); } return result; @@ -386,7 +386,7 @@ set_own_status (GObject *object, g_hash_table_insert (presences, GUINT_TO_POINTER (base->self_handle), (gpointer) status); tp_presence_mixin_emit_presence_update (object, presences); - g_hash_table_destroy (presences); + g_hash_table_unref (presences); return TRUE; } @@ -504,7 +504,7 @@ get_aliases (TpSvcConnectionInterfaceAliasing *aliasing, tp_svc_connection_interface_aliasing_return_from_get_aliases (context, result); - g_hash_table_destroy (result); + g_hash_table_unref (result); } static void diff --git a/examples/cm/echo-message-parts/im-manager.c b/examples/cm/echo-message-parts/im-manager.c index 3fb550d8f..3887ca05e 100644 --- a/examples/cm/echo-message-parts/im-manager.c +++ b/examples/cm/echo-message-parts/im-manager.c @@ -161,7 +161,7 @@ example_echo_2_im_manager_close_all (ExampleEcho2ImManager *self) GHashTable *tmp = self->priv->channels; self->priv->channels = NULL; - g_hash_table_destroy (tmp); + g_hash_table_unref (tmp); } if (self->priv->status_changed_id != 0) @@ -280,7 +280,7 @@ example_echo_2_im_manager_type_foreach_channel_class (GType type, func (type, table, allowed_properties, user_data); - g_hash_table_destroy (table); + g_hash_table_unref (table); } static gboolean diff --git a/examples/cm/extended/conn.c b/examples/cm/extended/conn.c index 9883992f1..60672084b 100644 --- a/examples/cm/extended/conn.c +++ b/examples/cm/extended/conn.c @@ -104,7 +104,7 @@ finalize (GObject *object) tp_contacts_mixin_finalize (object); g_free (self->priv->account); g_free (self->priv->hat_color); - g_hash_table_destroy (self->priv->hat_properties); + g_hash_table_unref (self->priv->hat_properties); G_OBJECT_CLASS (example_extended_connection_parent_class)->finalize (object); } diff --git a/examples/future/call-cm/call-channel.c b/examples/future/call-cm/call-channel.c index 8aa5809dc..85c87d625 100644 --- a/examples/future/call-cm/call-channel.c +++ b/examples/future/call-cm/call-channel.c @@ -576,7 +576,7 @@ example_call_channel_terminate (ExampleCallChannel *self, future_svc_channel_type_call_emit_call_members_changed (self, empty_uu_map, empty_uu_map, au, self->priv->call_state_reason); g_hash_table_unref (empty_uu_map); - g_array_free (au, TRUE); + g_array_unref (au); if (actor == tp_base_connection_get_self_handle (self->priv->conn)) { @@ -645,7 +645,7 @@ dispose (GObject *object) self->priv->disposed = TRUE; - g_hash_table_destroy (self->priv->contents); + g_hash_table_unref (self->priv->contents); self->priv->contents = NULL; /* FIXME: right error code? arguably this should always be a no-op */ @@ -668,7 +668,7 @@ finalize (GObject *object) (self->priv->conn, TP_HANDLE_TYPE_CONTACT); g_value_array_free (self->priv->call_state_reason); - g_hash_table_destroy (self->priv->call_state_details); + g_hash_table_unref (self->priv->call_state_details); tp_handle_unref (contact_handles, self->priv->handle); tp_handle_unref (contact_handles, self->priv->initiator); @@ -1232,7 +1232,7 @@ simulate_contact_ringing_cb (gpointer p) future_svc_channel_type_call_emit_call_members_changed (self, uu_map, us_map, empty_au, self->priv->call_state_reason); g_hash_table_unref (uu_map); - g_array_free (empty_au, TRUE); + g_array_unref (empty_au); /* In this example there is no real contact, so just simulate them diff --git a/examples/future/call-cm/call-content.c b/examples/future/call-cm/call-content.c index 52ebe49be..5bd6db6ee 100644 --- a/examples/future/call-cm/call-content.c +++ b/examples/future/call-cm/call-content.c @@ -356,7 +356,7 @@ example_call_content_stream_removed_cb (ExampleCallContent *self, G_TYPE_INVALID); future_svc_call_content_emit_streams_removed (self, paths, reason); g_free (path); - g_ptr_array_free (paths, TRUE); + g_ptr_array_unref (paths); g_value_array_free (reason); g_object_unref (self->priv->stream); @@ -382,7 +382,7 @@ example_call_content_add_stream (ExampleCallContent *self, g_ptr_array_add (paths, path); future_svc_call_content_emit_streams_added (self, paths); g_free (path); - g_ptr_array_free (paths, TRUE); + g_ptr_array_unref (paths); tp_g_signal_connect_object (stream, "removed", G_CALLBACK (example_call_content_stream_removed_cb), self, diff --git a/examples/future/call-cm/call-manager.c b/examples/future/call-cm/call-manager.c index 2bcb3320e..7f923a713 100644 --- a/examples/future/call-cm/call-manager.c +++ b/examples/future/call-cm/call-manager.c @@ -401,7 +401,7 @@ example_call_manager_type_foreach_channel_class (GType type, func (type, table, video_allowed_properties, user_data); - g_hash_table_destroy (table); + g_hash_table_unref (table); } static gboolean diff --git a/examples/future/call-cm/call-stream.c b/examples/future/call-cm/call-stream.c index 6eb3e4b0a..1b3cb2ec1 100644 --- a/examples/future/call-cm/call-stream.c +++ b/examples/future/call-cm/call-stream.c @@ -447,7 +447,7 @@ example_call_stream_simulate_contact_agreed_to_send (ExampleCallStream *self) identifiers, removed_members, reason); g_hash_table_unref (updated_members); g_hash_table_unref (identifiers); - g_array_free (removed_members, TRUE); + g_array_unref (removed_members); g_value_array_free (reason); } @@ -561,7 +561,7 @@ example_call_stream_change_direction (ExampleCallStream *self, updated_members, updated_member_identifiers, removed_members, reason); - g_array_free (removed_members, TRUE); + g_array_unref (removed_members); } g_hash_table_unref (updated_members); @@ -698,7 +698,7 @@ example_call_stream_receive_direction_request (ExampleCallStream *self, updated_members, updated_member_identifiers, removed_members, reason); - g_array_free (removed_members, TRUE); + g_array_unref (removed_members); } g_hash_table_unref (updated_members); diff --git a/examples/future/call-cm/conn.c b/examples/future/call-cm/conn.c index d8248c070..e5dbc64f9 100644 --- a/examples/future/call-cm/conn.c +++ b/examples/future/call-cm/conn.c @@ -280,7 +280,7 @@ get_contact_statuses (GObject *object, g_hash_table_insert (result, GUINT_TO_POINTER (contact), tp_presence_status_new (presence, parameters)); - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); } return result; @@ -335,7 +335,7 @@ set_own_status (GObject *object, g_hash_table_insert (presences, GUINT_TO_POINTER (base->self_handle), (gpointer) status); tp_presence_mixin_emit_presence_update (object, presences); - g_hash_table_destroy (presences); + g_hash_table_unref (presences); if (!self->priv->away) { diff --git a/telepathy-glib/account-channel-request.c b/telepathy-glib/account-channel-request.c index ffd256fec..df9100022 100644 --- a/telepathy-glib/account-channel-request.c +++ b/telepathy-glib/account-channel-request.c @@ -733,7 +733,7 @@ acr_channel_request_succeeded_with_channel (TpChannelRequest *chan_req, tp_proxy_prepare_async (self->priv->channel, (GQuark *) features->data, channel_prepare_cb, self); - g_array_free (features, TRUE); + g_array_unref (features); } else { diff --git a/telepathy-glib/account-manager.c b/telepathy-glib/account-manager.c index 447f4185f..3bb1535bc 100644 --- a/telepathy-glib/account-manager.c +++ b/telepathy-glib/account-manager.c @@ -531,7 +531,7 @@ _tp_account_manager_dispose (GObject *object) priv->dispose_run = TRUE; - g_hash_table_destroy (priv->accounts); + g_hash_table_unref (priv->accounts); g_hash_table_iter_init (&iter, self->priv->legacy_accounts); while (g_hash_table_iter_next (&iter, NULL, &value)) diff --git a/telepathy-glib/base-client.c b/telepathy-glib/base-client.c index c0ae23452..557feefcd 100644 --- a/telepathy-glib/base-client.c +++ b/telepathy-glib/base-client.c @@ -1027,10 +1027,10 @@ tp_base_client_finalize (GObject *object) g_free (self->priv->name); - g_ptr_array_free (self->priv->observer_filters, TRUE); - g_ptr_array_free (self->priv->approver_filters, TRUE); - g_ptr_array_free (self->priv->handler_filters, TRUE); - g_ptr_array_free (self->priv->handler_caps, TRUE); + g_ptr_array_unref (self->priv->observer_filters); + g_ptr_array_unref (self->priv->approver_filters); + g_ptr_array_unref (self->priv->handler_filters); + g_ptr_array_unref (self->priv->handler_caps); g_free (self->priv->bus_name); g_free (self->priv->object_path); diff --git a/telepathy-glib/base-connection-manager.c b/telepathy-glib/base-connection-manager.c index 96790ebf0..5c314c5a1 100644 --- a/telepathy-glib/base-connection-manager.c +++ b/telepathy-glib/base-connection-manager.c @@ -313,7 +313,7 @@ tp_base_connection_manager_dispose (GObject *object) if (priv->protocols != NULL) { - g_hash_table_destroy (priv->protocols); + g_hash_table_unref (priv->protocols); priv->protocols = NULL; } @@ -327,7 +327,7 @@ tp_base_connection_manager_finalize (GObject *object) TpBaseConnectionManager *self = TP_BASE_CONNECTION_MANAGER (object); TpBaseConnectionManagerPrivate *priv = self->priv; - g_hash_table_destroy (priv->connections); + g_hash_table_unref (priv->connections); G_OBJECT_CLASS (tp_base_connection_manager_parent_class)->finalize (object); } @@ -774,7 +774,7 @@ tp_cm_param_setter_offset (const TpCMParamSpec *paramspec, if (*save_to != NULL) { - g_array_free (*save_to, TRUE); + g_array_unref (*save_to); } *save_to = g_value_dup_boxed (value); DEBUG ("%s = ...[%u]", paramspec->name, (*save_to)->len); @@ -901,7 +901,7 @@ tp_base_connection_manager_get_parameters (TpSvcConnectionManager *iface, g_value_array_free (g_ptr_array_index (ret, i)); } - g_ptr_array_free (ret, TRUE); + g_ptr_array_unref (ret); } @@ -937,7 +937,7 @@ tp_base_connection_manager_list_protocols (TpSvcConnectionManager *iface, tp_svc_connection_manager_return_from_list_protocols ( context, (const gchar **) protocols->pdata); - g_ptr_array_free (protocols, TRUE); + g_ptr_array_unref (protocols); } diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c index d3d714378..49299d09a 100644 --- a/telepathy-glib/base-connection.c +++ b/telepathy-glib/base-connection.c @@ -603,17 +603,17 @@ tp_base_connection_dispose (GObject *object) tp_clear_object (&priv->bus_proxy); g_ptr_array_foreach (priv->channel_factories, (GFunc) g_object_unref, NULL); - g_ptr_array_free (priv->channel_factories, TRUE); + g_ptr_array_unref (priv->channel_factories); priv->channel_factories = NULL; g_ptr_array_foreach (priv->channel_managers, (GFunc) g_object_unref, NULL); - g_ptr_array_free (priv->channel_managers, TRUE); + g_ptr_array_unref (priv->channel_managers); priv->channel_managers = NULL; if (priv->channel_requests) { g_assert (priv->channel_requests->len == 0); - g_ptr_array_free (priv->channel_requests, TRUE); + g_ptr_array_unref (priv->channel_requests); priv->channel_requests = NULL; } @@ -622,7 +622,7 @@ tp_base_connection_dispose (GObject *object) if (priv->interfaces) { - g_array_free (priv->interfaces, TRUE); + g_array_unref (priv->interfaces); } if (G_OBJECT_CLASS (tp_base_connection_parent_class)->dispose) @@ -716,7 +716,7 @@ exportable_channel_get_old_info (TpExportableChannel *channel, } } - g_hash_table_destroy (channel_properties); + g_hash_table_unref (channel_properties); } @@ -879,7 +879,7 @@ satisfy_request (TpBaseConnection *conn, NULL); tp_svc_connection_interface_requests_return_from_create_channel ( request->context, object_path, properties); - g_hash_table_destroy (properties); + g_hash_table_unref (properties); } break; @@ -893,7 +893,7 @@ satisfy_request (TpBaseConnection *conn, NULL); tp_svc_connection_interface_requests_return_from_ensure_channel ( request->context, request->yours, object_path, properties); - g_hash_table_destroy (properties); + g_hash_table_unref (properties); } break; @@ -945,13 +945,13 @@ factory_satisfy_requests (TpBaseConnection *conn, g_ptr_array_add (array, get_channel_details (G_OBJECT (chan))); tp_svc_connection_interface_requests_emit_new_channels (conn, array); g_value_array_free (g_ptr_array_index (array, 0)); - g_ptr_array_free (array, TRUE); + g_ptr_array_unref (array); tp_svc_connection_emit_new_channel (conn, object_path, channel_type, handle_type, handle, suppress_handler); } - g_ptr_array_free (tmp, TRUE); + g_ptr_array_unref (tmp); g_free (object_path); g_free (channel_type); @@ -1040,7 +1040,7 @@ factory_channel_error_cb (TpChannelFactoryIface *factory, for (i = 0; i < tmp->len; i++) fail_channel_request (conn, g_ptr_array_index (tmp, i), error); - g_ptr_array_free (tmp, TRUE); + g_ptr_array_unref (tmp); g_free (channel_type); } @@ -1180,7 +1180,7 @@ manager_new_channels_cb (TpChannelManager *manager, array); g_ptr_array_foreach (array, (GFunc) g_value_array_free, NULL); - g_ptr_array_free (array, TRUE); + g_ptr_array_unref (array); /* Emit NewChannel */ g_hash_table_iter_init (&iter, channels); @@ -1202,7 +1202,7 @@ manager_new_channels_cb (TpChannelManager *manager, g_free (channel_type); } - g_hash_table_destroy (context.suppress_handler); + g_hash_table_unref (context.suppress_handler); } @@ -2299,12 +2299,12 @@ tp_base_connection_list_channels (TpSvcConnection *iface, tp_svc_connection_return_from_list_channels (context, channels); - g_ptr_array_free (channels, TRUE); + g_ptr_array_unref (channels); for (i = 0; i < values->len; i++) { tp_g_value_slice_free (g_ptr_array_index (values, i)); } - g_ptr_array_free (values, TRUE); + g_ptr_array_unref (values); } static void @@ -2399,7 +2399,7 @@ tp_base_connection_request_channel (TpSvcConnection *iface, } } - g_hash_table_destroy (request_properties); + g_hash_table_unref (request_properties); if (claimed_by_channel_manager) return; @@ -2602,7 +2602,7 @@ out: if (handles != NULL) { tp_handles_unref (handle_repo, handles); - g_array_free (handles, TRUE); + g_array_unref (handles); } } @@ -2691,7 +2691,7 @@ void tp_base_connection_finish_shutdown (TpBaseConnection *self) i)); } - g_ptr_array_free (contexts, TRUE); + g_ptr_array_unref (contexts); g_signal_emit (self, signals[SHUTDOWN_FINISHED], 0); } @@ -2752,7 +2752,7 @@ tp_base_connection_disconnect_with_dbus_error (TpBaseConnection *self, reason); if (dup_ != NULL) - g_hash_table_destroy (dup_); + g_hash_table_unref (dup_); } /** @@ -3576,7 +3576,7 @@ conn_requests_requestotron_validate_handle (TpBaseConnection *self, */ if (altered_properties != NULL) { - g_hash_table_destroy (altered_properties); + g_hash_table_unref (altered_properties); if (target_handle_value != NULL) tp_g_value_slice_free (target_handle_value); diff --git a/telepathy-glib/base-contact-list.c b/telepathy-glib/base-contact-list.c index a1b4e1f3b..d9d6f34ee 100644 --- a/telepathy-glib/base-contact-list.c +++ b/telepathy-glib/base-contact-list.c @@ -548,7 +548,7 @@ tp_base_contact_list_fail_channel_requests (TpBaseContactList *self, g_hash_table_iter_steal (&iter); } - g_hash_table_destroy (tmp); + g_hash_table_unref (tmp); } } @@ -989,7 +989,7 @@ tp_base_contact_list_type_foreach_channel_class (GType type, func (type, table, allowed_properties, user_data); } - g_hash_table_destroy (table); + g_hash_table_unref (table); } static void @@ -4731,7 +4731,7 @@ tp_base_contact_list_mixin_get_contact_list_attributes ( tp_svc_connection_interface_contact_list_return_from_get_contact_list_attributes ( context, result); - g_array_free (contacts, TRUE); + g_array_unref (contacts); tp_handle_set_destroy (set); g_free (sender); g_hash_table_unref (result); diff --git a/telepathy-glib/base-password-channel.c b/telepathy-glib/base-password-channel.c index 6aca38ce2..c85eda83d 100644 --- a/telepathy-glib/base-password-channel.c +++ b/telepathy-glib/base-password-channel.c @@ -409,7 +409,7 @@ tp_base_password_channel_finalize (GObject *object) TpBasePasswordChannel *self = TP_BASE_PASSWORD_CHANNEL (object); TpBasePasswordChannelPrivate *priv = self->priv; - tp_clear_pointer (&priv->sasl_error_details, g_hash_table_destroy); + tp_clear_pointer (&priv->sasl_error_details, g_hash_table_unref); tp_clear_pointer (&priv->sasl_error, g_free); tp_clear_pointer (&priv->authorization_identity, g_free); tp_clear_pointer (&priv->default_username, g_free); diff --git a/telepathy-glib/base-room-config.c b/telepathy-glib/base-room-config.c index 7a145de8e..56d627acd 100644 --- a/telepathy-glib/base-room-config.c +++ b/telepathy-glib/base-room-config.c @@ -330,7 +330,7 @@ tp_base_room_config_get_property ( g_ptr_array_add (property_names, NULL); g_value_take_boxed (value, g_strdupv ((gchar **) property_names->pdata)); - g_ptr_array_free (property_names, TRUE); + g_ptr_array_unref (property_names); break; } case PROP_CONFIGURATION_RETRIEVED: diff --git a/telepathy-glib/capabilities.c b/telepathy-glib/capabilities.c index cbfbeda02..121b261a6 100644 --- a/telepathy-glib/capabilities.c +++ b/telepathy-glib/capabilities.c @@ -263,7 +263,7 @@ _tp_capabilities_new (const GPtrArray *classes, NULL); if (empty != NULL) - g_ptr_array_free (empty, TRUE); + g_ptr_array_unref (empty); return self; } diff --git a/telepathy-glib/channel-dispatch-operation.c b/telepathy-glib/channel-dispatch-operation.c index c825838f3..acdeda5cc 100644 --- a/telepathy-glib/channel-dispatch-operation.c +++ b/telepathy-glib/channel-dispatch-operation.c @@ -467,7 +467,7 @@ tp_channel_dispatch_operation_dispose (GObject *object) if (self->priv->channels != NULL) { /* channels array has 'g_object_unref' has free_func */ - g_ptr_array_free (self->priv->channels, TRUE); + g_ptr_array_unref (self->priv->channels); self->priv->channels = NULL; } diff --git a/telepathy-glib/channel-group.c b/telepathy-glib/channel-group.c index 8145bdcdf..6692a2481 100644 --- a/telepathy-glib/channel-group.c +++ b/telepathy-glib/channel-group.c @@ -713,8 +713,8 @@ _tp_channel_emit_initial_sets (TpChannel *self) reason); } - g_array_free (added, TRUE); - g_array_free (remote_pending, TRUE); + g_array_unref (added); + g_array_unref (remote_pending); _tp_channel_continue_introspection (self); } diff --git a/telepathy-glib/channel-manager.c b/telepathy-glib/channel-manager.c index 507db93a8..d149aef74 100644 --- a/telepathy-glib/channel-manager.c +++ b/telepathy-glib/channel-manager.c @@ -397,7 +397,7 @@ tp_channel_manager_emit_new_channel (gpointer instance, NULL, NULL); g_hash_table_insert (channels, channel, request_tokens); g_signal_emit (instance, signals[S_NEW_CHANNELS], 0, channels); - g_hash_table_destroy (channels); + g_hash_table_unref (channels); } diff --git a/telepathy-glib/connection-contact-info.c b/telepathy-glib/connection-contact-info.c index cebbe93c4..e31cd742c 100644 --- a/telepathy-glib/connection-contact-info.c +++ b/telepathy-glib/connection-contact-info.c @@ -611,7 +611,7 @@ tp_connection_set_contact_info_async (TpConnection *self, contact_info, set_info_cb, result, g_object_unref, NULL); g_ptr_array_foreach (contact_info, (GFunc) g_value_array_free, NULL); - g_ptr_array_free (contact_info, TRUE); + g_ptr_array_unref (contact_info); } /** diff --git a/telepathy-glib/connection-handles.c b/telepathy-glib/connection-handles.c index 491f41d4f..092580f49 100644 --- a/telepathy-glib/connection-handles.c +++ b/telepathy-glib/connection-handles.c @@ -62,7 +62,7 @@ hold_handles_context_free (gpointer p) if (context->destroy != NULL) context->destroy (context->user_data); - g_array_free (context->handles, TRUE); + g_array_unref (context->handles); g_slice_free (HoldHandlesContext, context); } @@ -431,7 +431,7 @@ tp_connection_get_contact_attributes (TpConnection *self, tp_cli_connection_interface_contacts_call_get_contact_attributes (self, -1, a, (const gchar **) interfaces, TRUE, callback, user_data, destroy, weak_object); - g_array_free (a, TRUE); + g_array_unref (a); } /** diff --git a/telepathy-glib/connection-manager.c b/telepathy-glib/connection-manager.c index ae3c006db..b9377b32b 100644 --- a/telepathy-glib/connection-manager.c +++ b/telepathy-glib/connection-manager.c @@ -668,7 +668,7 @@ tp_connection_manager_end_introspection (TpConnectionManager *self, for (i = 0; i < self->priv->pending_protocols->len; i++) g_free (self->priv->pending_protocols->pdata[i]); - g_ptr_array_free (self->priv->pending_protocols, TRUE); + g_ptr_array_unref (self->priv->pending_protocols); self->priv->pending_protocols = NULL; } @@ -686,7 +686,7 @@ tp_connection_manager_update_protocol_structs (TpConnectionManager *self) g_assert (self->priv->protocol_objects != NULL); if (self->priv->protocol_structs != NULL) - g_ptr_array_free (self->priv->protocol_structs, TRUE); + g_ptr_array_unref (self->priv->protocol_structs); self->priv->protocol_structs = g_ptr_array_sized_new ( g_hash_table_size (self->priv->protocol_objects) + 1); @@ -1233,7 +1233,7 @@ tp_connection_manager_dispose (GObject *object) if (self->priv->protocol_structs != NULL) { - g_ptr_array_free (self->priv->protocol_structs, TRUE); + g_ptr_array_unref (self->priv->protocol_structs); self->priv->protocol_structs = NULL; } @@ -1272,7 +1272,7 @@ tp_connection_manager_finalize (GObject *object) for (i = 0; i < self->priv->pending_protocols->len; i++) g_free (self->priv->pending_protocols->pdata[i]); - g_ptr_array_free (self->priv->pending_protocols, TRUE); + g_ptr_array_unref (self->priv->pending_protocols); } G_OBJECT_CLASS (tp_connection_manager_parent_class)->finalize (object); @@ -1704,10 +1704,10 @@ list_context_unref (_ListContext *list_context) g_object_unref (cm); } - g_ptr_array_free (list_context->arr, TRUE); + g_ptr_array_unref (list_context->arr); } - g_hash_table_destroy (list_context->table); + g_hash_table_unref (list_context->table); g_slice_free (_ListContext, list_context); } diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index 728d4b96d..59fd7f1b0 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -1488,7 +1488,7 @@ tp_connection_finalize (GObject *object) if (self->priv->contact_attribute_interfaces != NULL) { - g_array_free (self->priv->contact_attribute_interfaces, TRUE); + g_array_unref (self->priv->contact_attribute_interfaces); self->priv->contact_attribute_interfaces = NULL; } @@ -1503,7 +1503,7 @@ tp_connection_finalize (GObject *object) if (self->priv->avatar_request_queue != NULL) { - g_array_free (self->priv->avatar_request_queue, TRUE); + g_array_unref (self->priv->avatar_request_queue); self->priv->avatar_request_queue = NULL; } @@ -1558,7 +1558,7 @@ tp_connection_dispose (GObject *object) { g_hash_table_foreach (self->priv->contacts, contact_notify_invalidated, NULL); - tp_clear_pointer (&self->priv->contacts, g_hash_table_destroy); + tp_clear_pointer (&self->priv->contacts, g_hash_table_unref); } tp_clear_object (&self->priv->capabilities); @@ -2823,7 +2823,7 @@ tp_list_connection_names_helper (TpDBusDaemon *bus_daemon, (const gchar * const *) protocols->pdata, NULL, list_context->user_data, user_object); - g_ptr_array_free (bus_names, TRUE); + g_ptr_array_unref (bus_names); g_strfreev ((char **) g_ptr_array_free (cms, FALSE)); g_strfreev ((char **) g_ptr_array_free (protocols, FALSE)); } diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c index 30987384a..6f9da3f32 100644 --- a/telepathy-glib/contact.c +++ b/telepathy-glib/contact.c @@ -1629,15 +1629,15 @@ contacts_context_unref (gpointer p) g_assert (c->contacts != NULL); g_ptr_array_foreach (c->contacts, (GFunc) g_object_unref, NULL); - g_ptr_array_free (c->contacts, TRUE); + g_ptr_array_unref (c->contacts); c->contacts = NULL; g_assert (c->handles != NULL); - g_array_free (c->handles, TRUE); + g_array_unref (c->handles); c->handles = NULL; g_assert (c->invalid != NULL); - g_array_free (c->invalid, TRUE); + g_array_unref (c->invalid); c->invalid = NULL; if (c->request_ids != NULL) @@ -1645,7 +1645,7 @@ contacts_context_unref (gpointer p) c->request_ids = NULL; - tp_clear_pointer (&c->request_errors, g_hash_table_destroy); + tp_clear_pointer (&c->request_errors, g_hash_table_unref); if (c->destroy != NULL) c->destroy (c->user_data); @@ -2715,7 +2715,7 @@ connection_avatar_request_idle_cb (gpointer user_data) tp_cli_connection_interface_avatars_call_request_avatars (connection, -1, connection->priv->avatar_request_queue, NULL, NULL, NULL, NULL); - g_array_free (connection->priv->avatar_request_queue, TRUE); + g_array_unref (connection->priv->avatar_request_queue); connection->priv->avatar_request_queue = NULL; connection->priv->avatar_request_idle_id = 0; @@ -3300,7 +3300,7 @@ tp_connection_refresh_contact_info (TpConnection *self, tp_cli_connection_interface_contact_info_call_refresh_contact_info (self, -1, handles, NULL, NULL, NULL, NULL); - g_array_free (handles, TRUE); + g_array_unref (handles); } static void @@ -4061,7 +4061,7 @@ lookup_all_contacts (ContactsContext *context) } else { - g_ptr_array_free (contacts, TRUE); + g_ptr_array_unref (contacts); contacts = NULL; break; } @@ -4204,7 +4204,7 @@ tp_connection_get_contacts_by_handle (TpConnection *self, g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, contacts_context_idle_continue, context, contacts_context_unref); - g_ptr_array_free (contacts, TRUE); + g_ptr_array_unref (contacts); return; } diff --git a/telepathy-glib/contacts-mixin.c b/telepathy-glib/contacts-mixin.c index 12fc25a0e..29b1431e7 100644 --- a/telepathy-glib/contacts-mixin.c +++ b/telepathy-glib/contacts-mixin.c @@ -258,7 +258,7 @@ tp_contacts_mixin_finalize (GObject *obj) DEBUG ("%p", obj); /* free any data held directly by the object here */ - g_hash_table_destroy (mixin->priv->interfaces); + g_hash_table_unref (mixin->priv->interfaces); g_slice_free (TpContactsMixinPrivate, mixin->priv); } @@ -308,7 +308,7 @@ tp_contacts_mixin_get_contact_attributes (GObject *obj, valid_handles = g_array_sized_new (TRUE, TRUE, sizeof (TpHandle), handles->len); result = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, - (GDestroyNotify) g_hash_table_destroy); + (GDestroyNotify) g_hash_table_unref); for (i = 0 ; i < handles->len ; i++) { @@ -353,7 +353,7 @@ tp_contacts_mixin_get_contact_attributes (GObject *obj, } tp_handles_unref (contact_repo, valid_handles); - g_array_free (valid_handles, TRUE); + g_array_unref (valid_handles); return result; } @@ -386,7 +386,7 @@ tp_contacts_mixin_get_contact_attributes_impl ( context, result); g_free (sender); - g_hash_table_destroy (result); + g_hash_table_unref (result); } /** diff --git a/telepathy-glib/dbus-daemon.c b/telepathy-glib/dbus-daemon.c index 8bf81f621..fcd367d1a 100644 --- a/telepathy-glib/dbus-daemon.c +++ b/telepathy-glib/dbus-daemon.c @@ -1338,7 +1338,7 @@ tp_dbus_daemon_dispose (GObject *object) g_hash_table_iter_remove (&iter); } - g_hash_table_destroy (tmp); + g_hash_table_unref (tmp); } if (self->priv->libdbus != NULL) diff --git a/telepathy-glib/dbus-properties-mixin.c b/telepathy-glib/dbus-properties-mixin.c index a88225e8e..1c1bb90a6 100644 --- a/telepathy-glib/dbus-properties-mixin.c +++ b/telepathy-glib/dbus-properties-mixin.c @@ -1186,7 +1186,7 @@ _tp_dbus_properties_mixin_get_all (TpSvcDBusProperties *iface, out: tp_svc_dbus_properties_return_from_get_all (context, values); - g_hash_table_destroy (values); + g_hash_table_unref (values); } /** diff --git a/telepathy-glib/dbus.c b/telepathy-glib/dbus.c index c5b1628a8..9b80b09ca 100644 --- a/telepathy-glib/dbus.c +++ b/telepathy-glib/dbus.c @@ -751,10 +751,10 @@ tp_g_value_slice_new_take_object_path (gchar *path) * </example> * * Allocated values will be automatically free'd when overwritten, removed or - * the hash table destroyed with g_hash_table_destroy(). + * the hash table destroyed with g_hash_table_unref(). * * Returns: a newly created #GHashTable for storing a{sv} maps, free with - * g_hash_table_destroy(). + * g_hash_table_unref(). * Since: 0.7.29 */ GHashTable * diff --git a/telepathy-glib/debug-sender.c b/telepathy-glib/debug-sender.c index b9792ce4a..f7800bb8a 100644 --- a/telepathy-glib/debug-sender.c +++ b/telepathy-glib/debug-sender.c @@ -310,7 +310,7 @@ get_messages (TpSvcDebug *self, for (j = 0; j < messages->len; j++) g_boxed_free (TP_STRUCT_TYPE_DEBUG_MESSAGE, messages->pdata[j]); - g_ptr_array_free (messages, TRUE); + g_ptr_array_unref (messages); } static void diff --git a/telepathy-glib/group-mixin.c b/telepathy-glib/group-mixin.c index 5bf68fdb3..18d5c163d 100644 --- a/telepathy-glib/group-mixin.c +++ b/telepathy-glib/group-mixin.c @@ -398,11 +398,11 @@ tp_group_mixin_finalize (GObject *obj) handle_owners_foreach_unref, mixin); - g_hash_table_destroy (mixin->priv->handle_owners); - g_hash_table_destroy (mixin->priv->local_pending_info); + g_hash_table_unref (mixin->priv->handle_owners); + g_hash_table_unref (mixin->priv->local_pending_info); if (mixin->priv->externals) - g_ptr_array_free (mixin->priv->externals, TRUE); + g_ptr_array_unref (mixin->priv->externals); g_slice_free (TpGroupMixinPrivate, mixin->priv); @@ -859,7 +859,7 @@ tp_group_mixin_get_members_async (TpSvcChannelInterfaceGroup *obj, { tp_svc_channel_interface_group_return_from_get_members ( context, ret); - g_array_free (ret, TRUE); + g_array_unref (ret); } else { @@ -901,7 +901,7 @@ tp_group_mixin_get_local_pending_members_async (TpSvcChannelInterfaceGroup *obj, { tp_svc_channel_interface_group_return_from_get_local_pending_members ( context, ret); - g_array_free (ret, TRUE); + g_array_unref (ret); } else { @@ -990,7 +990,7 @@ tp_group_mixin_get_local_pending_members_with_info_async ( for (i = 0 ; i < ret->len; i++) { g_value_array_free (g_ptr_array_index (ret,i)); } - g_ptr_array_free (ret, TRUE); + g_ptr_array_unref (ret); } else { @@ -1034,7 +1034,7 @@ tp_group_mixin_get_remote_pending_members_async (TpSvcChannelInterfaceGroup *obj { tp_svc_channel_interface_group_return_from_get_remote_pending_members ( context, ret); - g_array_free (ret, TRUE); + g_array_unref (ret); } else { @@ -1086,9 +1086,9 @@ tp_group_mixin_get_all_members_async (TpSvcChannelInterfaceGroup *obj, { tp_svc_channel_interface_group_return_from_get_all_members ( context, mem, local, remote); - g_array_free (mem, TRUE); - g_array_free (local, TRUE); - g_array_free (remote, TRUE); + g_array_unref (mem); + g_array_unref (local); + g_array_unref (remote); } else { @@ -1148,7 +1148,7 @@ tp_group_mixin_get_handle_owners (GObject *obj, g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT, "handle %u is not a member", local_handle); - g_array_free (*ret, TRUE); + g_array_unref (*ret); *ret = NULL; return FALSE; @@ -1177,7 +1177,7 @@ tp_group_mixin_get_handle_owners_async (TpSvcChannelInterfaceGroup *obj, { tp_svc_channel_interface_group_return_from_get_handle_owners ( context, ret); - g_array_free (ret, TRUE); + g_array_unref (ret); } else { @@ -1680,15 +1680,15 @@ change_members (GObject *obj, tp_handles_unref (mixin->handle_repo, arr_owners_removed); - g_hash_table_destroy (empty_hash_table); + g_hash_table_unref (empty_hash_table); } /* free arrays */ - g_array_free (arr_add, TRUE); - g_array_free (arr_remove, TRUE); - g_array_free (arr_local, TRUE); - g_array_free (arr_remote, TRUE); - g_array_free (arr_owners_removed, TRUE); + g_array_unref (arr_add); + g_array_unref (arr_remove); + g_array_unref (arr_local); + g_array_unref (arr_remote); + g_array_unref (arr_owners_removed); ret = TRUE; } @@ -1780,7 +1780,7 @@ tp_group_mixin_change_members (GObject *obj, ret = change_members (obj, message, add, del, add_local_pending, add_remote_pending, actor, reason, details); - g_hash_table_destroy (details); + g_hash_table_unref (details); return ret; } @@ -1899,7 +1899,7 @@ tp_group_mixin_add_handle_owner (GObject *obj, tp_group_mixin_add_handle_owners (obj, tmp); - g_hash_table_destroy (tmp); + g_hash_table_unref (tmp); } @@ -2013,7 +2013,7 @@ tp_group_mixin_add_handle_owners (GObject *obj, tp_svc_channel_interface_group_emit_handle_owners_changed_detailed (obj, local_to_owner_handle, empty_array, ids); - g_array_free (empty_array, TRUE); + g_array_unref (empty_array); g_hash_table_unref (ids); } diff --git a/telepathy-glib/handle-repo-dynamic.c b/telepathy-glib/handle-repo-dynamic.c index 1ba48ea68..15cdd2f3e 100644 --- a/telepathy-glib/handle-repo-dynamic.c +++ b/telepathy-glib/handle-repo-dynamic.c @@ -214,8 +214,8 @@ dynamic_finalize (GObject *obj) TpHandlePriv, i)); } - g_array_free (self->handle_to_priv, TRUE); - g_hash_table_destroy (self->string_to_handle); + g_array_unref (self->handle_to_priv); + g_hash_table_unref (self->string_to_handle); if (parent->finalize) parent->finalize (obj); diff --git a/telepathy-glib/heap.c b/telepathy-glib/heap.c index 3f3ac4cdb..8f7518039 100644 --- a/telepathy-glib/heap.c +++ b/telepathy-glib/heap.c @@ -89,7 +89,7 @@ tp_heap_destroy (TpHeap * heap) } } - g_ptr_array_free (heap->data, TRUE); + g_ptr_array_unref (heap->data); g_slice_free (TpHeap, heap); } @@ -115,7 +115,7 @@ tp_heap_clear (TpHeap *heap) } } - g_ptr_array_free (heap->data, TRUE); + g_ptr_array_unref (heap->data); heap->data = g_ptr_array_sized_new (DEFAULT_SIZE); } diff --git a/telepathy-glib/intset.c b/telepathy-glib/intset.c index 5546fe91c..4f93f783c 100644 --- a/telepathy-glib/intset.c +++ b/telepathy-glib/intset.c @@ -267,7 +267,7 @@ tp_intset_destroy (TpIntset *set) { g_return_if_fail (set != NULL); - g_hash_table_destroy (set->table); + g_hash_table_unref (set->table); g_slice_free (TpIntset, set); } diff --git a/telepathy-glib/message-mixin.c b/telepathy-glib/message-mixin.c index eb47fa1f2..a749aa100 100644 --- a/telepathy-glib/message-mixin.c +++ b/telepathy-glib/message-mixin.c @@ -375,7 +375,7 @@ tp_message_mixin_finalize (GObject *obj) tp_message_mixin_clear (obj); g_assert (g_queue_is_empty (mixin->priv->pending)); g_queue_free (mixin->priv->pending); - g_array_free (mixin->priv->msg_types, TRUE); + g_array_unref (mixin->priv->msg_types); g_strfreev (mixin->priv->supported_content_types); g_object_unref (mixin->priv->connection); @@ -522,7 +522,7 @@ tp_message_mixin_list_pending_messages_async (TpSvcChannelTypeText *iface, tp_svc_channel_interface_messages_emit_pending_messages_removed (iface, ids); - g_array_free (ids, TRUE); + g_array_unref (ids); } tp_svc_channel_type_text_return_from_list_pending_messages (context, @@ -531,7 +531,7 @@ tp_message_mixin_list_pending_messages_async (TpSvcChannelTypeText *iface, for (i = 0; i < messages->len; i++) g_value_array_free (g_ptr_array_index (messages, i)); - g_ptr_array_free (messages, TRUE); + g_ptr_array_unref (messages); } static void @@ -611,7 +611,7 @@ tp_message_mixin_get_pending_message_content_async ( tp_svc_channel_interface_messages_return_from_get_pending_message_content ( context, ret); - g_hash_table_destroy (ret); + g_hash_table_unref (ret); } static void diff --git a/telepathy-glib/message.c b/telepathy-glib/message.c index 4cf1a5199..68507a96a 100644 --- a/telepathy-glib/message.c +++ b/telepathy-glib/message.c @@ -79,10 +79,10 @@ tp_message_dispose (GObject *object) { for (i = 0; i < self->parts->len; i++) { - g_hash_table_destroy (g_ptr_array_index (self->parts, i)); + g_hash_table_unref (g_ptr_array_index (self->parts, i)); } - g_ptr_array_free (self->parts, TRUE); + g_ptr_array_unref (self->parts); self->parts = NULL; } @@ -755,7 +755,7 @@ tp_message_to_text (TpMessage *message, * that counts as "non-text content" I think */ DEBUG ("... didn't understand it, setting NON_TEXT_CONTENT"); flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT; - tp_clear_pointer (&alternatives_needed, g_hash_table_destroy); + tp_clear_pointer (&alternatives_needed, g_hash_table_unref); } } else if ((flags & TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT) == 0) @@ -769,7 +769,7 @@ tp_message_to_text (TpMessage *message, * (attached image or something, perhaps) */ DEBUG ("... ... yes, no possibility of a text alternative"); flags |= TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT; - tp_clear_pointer (&alternatives_needed, g_hash_table_destroy); + tp_clear_pointer (&alternatives_needed, g_hash_table_unref); } else if (alternatives_used != NULL && g_hash_table_lookup (alternatives_used, (gpointer) alternative) @@ -804,10 +804,10 @@ tp_message_to_text (TpMessage *message, } if (alternatives_needed != NULL) - g_hash_table_destroy (alternatives_needed); + g_hash_table_unref (alternatives_needed); if (alternatives_used != NULL) - g_hash_table_destroy (alternatives_used); + g_hash_table_unref (alternatives_used); if (out_flags != NULL) { diff --git a/telepathy-glib/presence-mixin.c b/telepathy-glib/presence-mixin.c index a1a88a7f0..31731f3e8 100644 --- a/telepathy-glib/presence-mixin.c +++ b/telepathy-glib/presence-mixin.c @@ -191,7 +191,7 @@ * contacts. The returned hash table should have contact handles mapped to * their respective presence statuses in #TpPresenceStatus structs. * - * The returned hash table will be freed with g_hash_table_destroy. The + * The returned hash table will be freed with g_hash_table_unref. The * callback is responsible for ensuring that this does any cleanup that * may be necessary. * @@ -359,7 +359,7 @@ tp_presence_status_free (TpPresenceStatus *status) return; if (status->optional_arguments) - g_hash_table_destroy (status->optional_arguments); + g_hash_table_unref (status->optional_arguments); g_slice_free (TpPresenceStatus, status); } @@ -529,7 +529,7 @@ construct_presence_hash_foreach ( GValueArray *vals; contact_status = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, - (GDestroyNotify) g_hash_table_destroy); + (GDestroyNotify) g_hash_table_unref); parameters = deep_copy_hashtable (status->optional_arguments); @@ -603,7 +603,7 @@ tp_presence_mixin_emit_presence_update (GObject *obj, tp_svc_connection_interface_presence_emit_presence_update (obj, presence_hash); - g_hash_table_destroy (presence_hash); + g_hash_table_unref (presence_hash); } if (g_type_interface_peek (G_OBJECT_GET_CLASS (obj), @@ -614,7 +614,7 @@ tp_presence_mixin_emit_presence_update (GObject *obj, tp_svc_connection_interface_simple_presence_emit_presences_changed (obj, presence_hash); - g_hash_table_destroy (presence_hash); + g_hash_table_unref (presence_hash); } } @@ -642,7 +642,7 @@ tp_presence_mixin_emit_one_presence_update (GObject *obj, (gpointer) status); tp_presence_mixin_emit_presence_update (obj, contact_statuses); - g_hash_table_destroy (contact_statuses); + g_hash_table_unref (contact_statuses); } @@ -740,7 +740,7 @@ tp_presence_mixin_get_presence (TpSvcConnectionInterfacePresence *iface, presence_hash = g_hash_table_new (g_direct_hash, g_direct_equal); tp_svc_connection_interface_presence_return_from_get_presence (context, presence_hash); - g_hash_table_destroy (presence_hash); + g_hash_table_unref (presence_hash); return; } @@ -764,8 +764,8 @@ tp_presence_mixin_get_presence (TpSvcConnectionInterfacePresence *iface, contact_statuses); tp_svc_connection_interface_presence_return_from_get_presence (context, presence_hash); - g_hash_table_destroy (presence_hash); - g_hash_table_destroy (contact_statuses); + g_hash_table_unref (presence_hash); + g_hash_table_unref (contact_statuses); } @@ -894,7 +894,7 @@ tp_presence_mixin_get_statuses (TpSvcConnectionInterfacePresence *iface, } tp_svc_connection_interface_presence_return_from_get_statuses (context, ret); - g_hash_table_destroy (ret); + g_hash_table_unref (ret); } @@ -957,7 +957,7 @@ tp_presence_mixin_remove_status (TpSvcConnectionInterfacePresence *iface, { dbus_g_method_return_error (context, error); g_error_free (error); - g_array_free (self_contacts, TRUE); + g_array_unref (self_contacts); return; } @@ -967,8 +967,8 @@ tp_presence_mixin_remove_status (TpSvcConnectionInterfacePresence *iface, if (!self_status) { DEBUG ("Got no self status, assuming we already have default status"); - g_array_free (self_contacts, TRUE); - g_hash_table_destroy (self_contact_statuses); + g_array_unref (self_contacts); + g_hash_table_unref (self_contact_statuses); tp_svc_connection_interface_presence_return_from_remove_status (context); return; } @@ -992,8 +992,8 @@ tp_presence_mixin_remove_status (TpSvcConnectionInterfacePresence *iface, dbus_g_method_return_error (context, &nonexistent); } - g_array_free (self_contacts, TRUE); - g_hash_table_destroy (self_contact_statuses); + g_array_unref (self_contacts); + g_hash_table_unref (self_contact_statuses); } @@ -1049,7 +1049,7 @@ tp_presence_mixin_request_presence (TpSvcConnectionInterfacePresence *iface, tp_presence_mixin_emit_presence_update (obj, contact_statuses); tp_svc_connection_interface_presence_return_from_request_presence (context); - g_hash_table_destroy (contact_statuses); + g_hash_table_unref (contact_statuses); } static int @@ -1155,7 +1155,7 @@ set_status ( ret = mixin_cls->set_own_status (obj, &status_to_set, error); if (optional_arguments) - g_hash_table_destroy (optional_arguments); + g_hash_table_unref (optional_arguments); return ret; } @@ -1422,7 +1422,7 @@ out: } if (optional_arguments != NULL) - g_hash_table_destroy (optional_arguments); + g_hash_table_unref (optional_arguments); } static GValueArray * @@ -1531,7 +1531,7 @@ tp_presence_mixin_simple_presence_get_presences ( presence_hash = g_hash_table_new (g_direct_hash, g_direct_equal); tp_svc_connection_interface_simple_presence_return_from_get_presences ( context, presence_hash); - g_hash_table_destroy (presence_hash); + g_hash_table_unref (presence_hash); return; } @@ -1555,8 +1555,8 @@ tp_presence_mixin_simple_presence_get_presences ( contact_statuses); tp_svc_connection_interface_simple_presence_return_from_get_presences ( context, presence_hash); - g_hash_table_destroy (presence_hash); - g_hash_table_destroy (contact_statuses); + g_hash_table_unref (presence_hash); + g_hash_table_unref (contact_statuses); } /** @@ -1618,7 +1618,7 @@ tp_presence_mixin_simple_presence_fill_contact_attributes (GObject *obj, tp_g_value_slice_new_take_boxed (G_TYPE_VALUE_ARRAY, presence)); } - g_hash_table_destroy (contact_statuses); + g_hash_table_unref (contact_statuses); } } diff --git a/telepathy-glib/properties-mixin.c b/telepathy-glib/properties-mixin.c index 86648f0a9..43ef828e8 100644 --- a/telepathy-glib/properties-mixin.c +++ b/telepathy-glib/properties-mixin.c @@ -1081,7 +1081,7 @@ get_properties (TpSvcPropertiesInterface *iface, } tp_svc_properties_interface_return_from_get_properties ( context, ret); - g_ptr_array_free (ret, TRUE); + g_ptr_array_unref (ret); } @@ -1118,7 +1118,7 @@ list_properties (TpSvcPropertiesInterface *iface, for (i = 0; i < ret->len; i++) g_boxed_free (TP_STRUCT_TYPE_PROPERTY_SPEC, ret->pdata[i]); - g_ptr_array_free (ret, TRUE); + g_ptr_array_unref (ret); } diff --git a/telepathy-glib/proxy.c b/telepathy-glib/proxy.c index 0a0b6dce7..e1e102624 100644 --- a/telepathy-glib/proxy.c +++ b/telepathy-glib/proxy.c @@ -364,7 +364,7 @@ tp_proxy_prepare_request_finish (TpProxyPrepareRequest *req, g_object_unref (req->result); } - g_array_free (req->features, TRUE); + g_array_unref (req->features); g_slice_free (TpProxyPrepareRequest, req); } @@ -1083,7 +1083,7 @@ tp_proxy_constructor (GType type, g_type_name (ancestor_type)); } - g_array_free (core_features, TRUE); + g_array_unref (core_features); } g_return_val_if_fail (self->dbus_connection != NULL, NULL); diff --git a/telepathy-glib/text-channel.c b/telepathy-glib/text-channel.c index 0b4c021fe..3ef0c56fb 100644 --- a/telepathy-glib/text-channel.c +++ b/telepathy-glib/text-channel.c @@ -1394,7 +1394,7 @@ tp_text_channel_ack_messages_async (TpTextChannel *self, tp_cli_channel_type_text_call_acknowledge_pending_messages (chan, -1, ids, acknowledge_pending_messages_cb, result, NULL, G_OBJECT (self)); - g_array_free (ids, TRUE); + g_array_unref (ids); } /** @@ -1475,7 +1475,7 @@ tp_text_channel_ack_message_async (TpTextChannel *self, tp_cli_channel_type_text_call_acknowledge_pending_messages (chan, -1, ids, acknowledge_pending_messages_cb, result, NULL, G_OBJECT (self)); - g_array_free (ids, TRUE); + g_array_unref (ids); } /** diff --git a/telepathy-glib/text-mixin.c b/telepathy-glib/text-mixin.c index cd0980a32..b93b76f4c 100644 --- a/telepathy-glib/text-mixin.c +++ b/telepathy-glib/text-mixin.c @@ -262,7 +262,7 @@ tp_text_mixin_finalize (GObject *obj) g_queue_free (mixin->priv->pending); - g_array_free (mixin->priv->msg_types, TRUE); + g_array_unref (mixin->priv->msg_types); g_slice_free (TpTextMixinPrivate, mixin->priv); } @@ -536,7 +536,7 @@ tp_text_mixin_list_pending_messages_async (TpSvcChannelTypeText *iface, for (i = 0; i < ret->len; i++) g_value_array_free (g_ptr_array_index (ret, i)); - g_ptr_array_free (ret, TRUE); + g_ptr_array_unref (ret); } else { diff --git a/tests/asv.c b/tests/asv.c index 0bfdce405..49606ec8c 100644 --- a/tests/asv.c +++ b/tests/asv.c @@ -687,7 +687,7 @@ int main (int argc, char **argv) /* Teardown */ - g_hash_table_destroy (hash); + g_hash_table_unref (hash); return 0; } diff --git a/tests/dbus/account.c b/tests/dbus/account.c index ccad46a8e..77c0c519a 100644 --- a/tests/dbus/account.c +++ b/tests/dbus/account.c @@ -181,7 +181,7 @@ teardown (Test *test, test->account = NULL; } - g_hash_table_destroy (test->times_notified); + g_hash_table_unref (test->times_notified); test->times_notified = NULL; /* make sure any pending calls on the account have happened, so it can die */ @@ -703,7 +703,7 @@ test_connection (Test *test, g_assert_cmpstr (tp_proxy_get_object_path (conn), ==, CONN1_PATH); g_assert_cmpuint (test_get_times_notified (test, "connection"), ==, 1); - g_hash_table_destroy (change); + g_hash_table_unref (change); } int diff --git a/tests/dbus/base-client.c b/tests/dbus/base-client.c index 256a66154..a8cfd426d 100644 --- a/tests/dbus/base-client.c +++ b/tests/dbus/base-client.c @@ -598,8 +598,8 @@ test_observer (Test *test, g_assert (tp_proxy_get_invalidated (chan) != NULL); g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); - g_ptr_array_free (requests_satisified, TRUE); + g_ptr_array_unref (channels); + g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } @@ -770,7 +770,7 @@ test_approver (Test *test, g_assert_no_error (test->error); g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); + g_ptr_array_unref (channels); g_hash_table_unref (properties); } @@ -955,8 +955,8 @@ test_handler (Test *test, g_object_unref (client_2); g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); - g_ptr_array_free (requests_satisified, TRUE); + g_ptr_array_unref (channels); + g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } @@ -1132,8 +1132,8 @@ test_handler_requests (Test *test, g_hash_table_unref (properties); g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); - g_ptr_array_free (requests_satisified, TRUE); + g_ptr_array_unref (channels); + g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } @@ -1242,7 +1242,7 @@ test_channel_dispatch_operation_claim_with_async (Test *test, test->text_chan_2)); g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); + g_ptr_array_unref (channels); g_hash_table_unref (properties); } @@ -1366,8 +1366,8 @@ test_delegate_channels (Test *test, test->text_chan_2)); g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); - g_ptr_array_free (requests_satisified, TRUE); + g_ptr_array_unref (channels); + g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } @@ -1553,9 +1553,9 @@ delegate_to_preferred_handler (Test *test, g_object_unref (cr); g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); - g_ptr_array_free (requests_satisified, TRUE); - g_ptr_array_free (requests, TRUE); + g_ptr_array_unref (channels); + g_ptr_array_unref (requests_satisified); + g_ptr_array_unref (requests); g_hash_table_unref (info); g_hash_table_unref (hints); g_hash_table_unref (request_props); diff --git a/tests/dbus/call-example.c b/tests/dbus/call-example.c index a0923dd55..905a14c2e 100644 --- a/tests/dbus/call-example.c +++ b/tests/dbus/call-example.c @@ -131,7 +131,7 @@ setup (Test *test, test->stream_ids = g_array_sized_new (FALSE, FALSE, sizeof (guint), 2); - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); g_free (bus_name); g_free (object_path); } @@ -314,7 +314,7 @@ outgoing_call (Test *test, tp_cli_connection_interface_requests_call_create_channel (test->conn, -1, request, channel_created_cb, test, NULL, NULL); - g_hash_table_destroy (request); + g_hash_table_unref (request); request = NULL; g_main_loop_run (test->mainloop); @@ -1053,10 +1053,10 @@ teardown (Test *test, test->members_changed_detailed_id); } - g_array_free (test->audio_request, TRUE); - g_array_free (test->video_request, TRUE); - g_array_free (test->invalid_request, TRUE); - g_array_free (test->stream_ids, TRUE); + g_array_unref (test->audio_request); + g_array_unref (test->video_request); + g_array_unref (test->invalid_request); + g_array_unref (test->stream_ids); tp_clear_pointer (&test->get_all_return, g_hash_table_unref); tp_clear_boxed (TP_ARRAY_TYPE_OBJECT_PATH_LIST, &test->get_contents_return); diff --git a/tests/dbus/callable-example.c b/tests/dbus/callable-example.c index b3703f5f2..72154514d 100644 --- a/tests/dbus/callable-example.c +++ b/tests/dbus/callable-example.c @@ -77,7 +77,7 @@ group_event_destroy (GroupEvent *ge) tp_intset_destroy (ge->remote_pending); if (ge->details != NULL) - g_hash_table_destroy (ge->details); + g_hash_table_unref (ge->details); g_slice_free (GroupEvent, ge); } @@ -272,7 +272,7 @@ setup (Test *test, test->stream_ids = g_array_sized_new (FALSE, FALSE, sizeof (guint), 2); test->contacts = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1); - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); g_free (bus_name); g_free (object_path); } @@ -535,7 +535,7 @@ outgoing_call (Test *test, tp_cli_connection_interface_requests_call_create_channel (test->conn, -1, request, channel_created_cb, test, NULL, NULL); - g_hash_table_destroy (request); + g_hash_table_unref (request); request = NULL; g_main_loop_run (test->mainloop); @@ -1509,11 +1509,11 @@ teardown (Test *test, test->members_changed_detailed_id); } - g_array_free (test->audio_request, TRUE); - g_array_free (test->video_request, TRUE); - g_array_free (test->invalid_request, TRUE); - g_array_free (test->stream_ids, TRUE); - g_array_free (test->contacts, TRUE); + g_array_unref (test->audio_request); + g_array_unref (test->video_request); + g_array_unref (test->invalid_request); + g_array_unref (test->stream_ids); + g_array_unref (test->contacts); g_slist_foreach (test->group_events, (GFunc) group_event_destroy, NULL); g_slist_free (test->group_events); @@ -1526,9 +1526,9 @@ teardown (Test *test, tp_clear_boxed (TP_ARRAY_TYPE_MEDIA_STREAM_INFO_LIST, &test->request_streams_return); - g_hash_table_destroy (test->stream_directions); - g_hash_table_destroy (test->stream_pending_sends); - g_hash_table_destroy (test->stream_states); + g_hash_table_unref (test->stream_directions); + g_hash_table_unref (test->stream_pending_sends); + g_hash_table_unref (test->stream_states); tp_clear_object (&test->chan); tp_clear_object (&test->conn); diff --git a/tests/dbus/channel-introspect.c b/tests/dbus/channel-introspect.c index a1695bc49..5d3038102 100644 --- a/tests/dbus/channel-introspect.c +++ b/tests/dbus/channel-introspect.c @@ -421,7 +421,7 @@ main (int argc, chan = tp_channel_new_from_properties (conn, props_chan_path, asv, &error); g_assert_no_error (error); - g_hash_table_destroy (asv); + g_hash_table_unref (asv); asv = NULL; MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); @@ -482,7 +482,7 @@ main (int argc, chan = tp_channel_new_from_properties (conn, props_group_chan_path, asv, &error); g_assert_no_error (error); - g_hash_table_destroy (asv); + g_hash_table_unref (asv); asv = NULL; MYASSERT (tp_channel_run_until_ready (chan, &error, NULL), ""); @@ -651,7 +651,7 @@ main (int argc, chan = tp_channel_new_from_properties (conn, chan_path, asv, &error); g_assert_no_error (error); - g_hash_table_destroy (asv); + g_hash_table_unref (asv); asv = NULL; MYASSERT (!tp_channel_run_until_ready (chan, &error, NULL), ""); diff --git a/tests/dbus/cli-group.c b/tests/dbus/cli-group.c index 73db1a989..b2b51f2a1 100644 --- a/tests/dbus/cli-group.c +++ b/tests/dbus/cli-group.c @@ -182,8 +182,8 @@ test_channel_proxy (TpTestsTextChannelGroup *service_chan, g_hash_table_unref (details); } - g_array_free (yarr, TRUE); - g_array_free (arr, TRUE); + g_array_unref (yarr); + g_array_unref (arr); tp_tests_proxy_run_until_dbus_queue_processed (conn); diff --git a/tests/dbus/client-channel-factory.c b/tests/dbus/client-channel-factory.c index 4a2abe422..4b06e1509 100644 --- a/tests/dbus/client-channel-factory.c +++ b/tests/dbus/client-channel-factory.c @@ -176,7 +176,7 @@ test_basic_stream_tube (Test *test, g_free (chan_path); g_hash_table_unref (props); - g_array_free (features, TRUE); + g_array_unref (features); } static void @@ -212,7 +212,7 @@ test_auto_stream_tube (Test *test, g_free (chan_path); g_hash_table_unref (props); - g_array_free (features, TRUE); + g_array_unref (features); } static void diff --git a/tests/dbus/cm-message.c b/tests/dbus/cm-message.c index 597e27290..b9741baa6 100644 --- a/tests/dbus/cm-message.c +++ b/tests/dbus/cm-message.c @@ -74,7 +74,7 @@ test_new_from_parts (Test *test, msg = _tp_cm_message_new_from_parts (test->base_connection, parts); - g_ptr_array_free (parts, TRUE); + g_ptr_array_unref (parts); g_assert (TP_IS_CM_MESSAGE (msg)); g_assert_cmpuint (tp_message_count_parts (msg), ==, 2); diff --git a/tests/dbus/connection-bug-18845.c b/tests/dbus/connection-bug-18845.c index 818251cc1..2ce979f5d 100644 --- a/tests/dbus/connection-bug-18845.c +++ b/tests/dbus/connection-bug-18845.c @@ -82,7 +82,7 @@ main (int argc, TP_HANDLE_TYPE_CONTACT, ids, &handles, &error, NULL), ""); g_assert_no_error (error); - g_array_free (handles, TRUE); + g_array_unref (handles); } /* The bug was in cleaning up handle refs when the CM fell off the bus. diff --git a/tests/dbus/connection-handles.c b/tests/dbus/connection-handles.c index 434607fae..f48e49e3c 100644 --- a/tests/dbus/connection-handles.c +++ b/tests/dbus/connection-handles.c @@ -158,7 +158,7 @@ test_request_and_release (TpTestsSimpleConnection *service_conn, /* clean up */ g_strfreev (result.ids); - g_array_free (result.handles, TRUE); + g_array_unref (result.handles); g_assert (result.error == NULL); g_main_loop_unref (result.loop); } @@ -242,7 +242,7 @@ test_request_hold_release (TpTestsSimpleConnection *service_conn, MYASSERT (want == got, "%u != %u", want, got); } - g_array_free (saved_handles, TRUE); + g_array_unref (saved_handles); /* unref the handles */ @@ -273,7 +273,7 @@ test_request_hold_release (TpTestsSimpleConnection *service_conn, g_main_loop_unref (result.loop); g_strfreev (result.ids); - g_array_free (result.handles, TRUE); + g_array_unref (result.handles); g_assert (result.error == NULL); } diff --git a/tests/dbus/connection-interests.c b/tests/dbus/connection-interests.c index 75d65ae36..071981cd4 100644 --- a/tests/dbus/connection-interests.c +++ b/tests/dbus/connection-interests.c @@ -256,7 +256,7 @@ teardown (Test *test, dbus_connection_close (test->client_libdbus); dbus_connection_unref (test->client_libdbus); - g_ptr_array_free (test->log, TRUE); + g_ptr_array_unref (test->log); } static void diff --git a/tests/dbus/contact-lists.c b/tests/dbus/contact-lists.c index 2a9753072..8b35a8775 100644 --- a/tests/dbus/contact-lists.c +++ b/tests/dbus/contact-lists.c @@ -451,10 +451,10 @@ teardown (Test *test, gboolean ok; GError *error = NULL; - g_array_free (test->arr, TRUE); + g_array_unref (test->arr); test_clear_log (test); - g_ptr_array_free (test->log, TRUE); + g_ptr_array_unref (test->log); tp_handle_unref (test->contact_repo, test->sjoerd); tp_handle_unref (test->contact_repo, test->helen); diff --git a/tests/dbus/contacts-mixin.c b/tests/dbus/contacts-mixin.c index a981290a2..a2a88a551 100644 --- a/tests/dbus/contacts-mixin.c +++ b/tests/dbus/contacts-mixin.c @@ -55,7 +55,7 @@ test_no_features (TpTestsContactsConnection *service_conn, tp_asv_get_string (attrs, TP_IFACE_CONNECTION "/contact-id"), ==, "chris"); - g_hash_table_destroy (contacts); + g_hash_table_unref (contacts); } static void @@ -125,7 +125,7 @@ test_features (TpTestsContactsConnection *service_conn, TP_IFACE_CONNECTION_INTERFACE_AVATARS "/token"), ==, "ccccc"); - g_hash_table_destroy (contacts); + g_hash_table_unref (contacts); } int @@ -216,7 +216,7 @@ main (int argc, g_free (conn_path); g_object_unref (dbus); - g_array_free (handles, TRUE); + g_array_unref (handles); return 0; } diff --git a/tests/dbus/contacts-slow-path.c b/tests/dbus/contacts-slow-path.c index 9804f751a..a75e40dd5 100644 --- a/tests/dbus/contacts-slow-path.c +++ b/tests/dbus/contacts-slow-path.c @@ -176,9 +176,9 @@ test_by_handle (Fixture *f, g_assert_cmpstr (tp_contact_get_identifier (contacts[3]), ==, "chris"); /* clean up before doing the second request */ - g_array_free (result.invalid, TRUE); + g_array_unref (result.invalid); result.invalid = NULL; - g_ptr_array_free (result.contacts, TRUE); + g_ptr_array_unref (result.contacts); result.contacts = NULL; g_assert (result.error == NULL); @@ -244,8 +244,8 @@ test_by_handle (Fixture *f, /* remaining cleanup */ g_main_loop_unref (result.loop); - g_array_free (result.invalid, TRUE); - g_ptr_array_free (result.contacts, TRUE); + g_array_unref (result.invalid); + g_ptr_array_unref (result.contacts); g_assert (result.error == NULL); } @@ -319,8 +319,8 @@ test_no_features (Fixture *f, /* remaining cleanup */ g_main_loop_unref (result.loop); - g_array_free (result.invalid, TRUE); - g_ptr_array_free (result.contacts, TRUE); + g_array_unref (result.invalid); + g_ptr_array_unref (result.contacts); g_assert (result.error == NULL); } @@ -453,9 +453,9 @@ test_upgrade (Fixture *f, } /* clean up before doing the second request */ - g_array_free (result.invalid, TRUE); + g_array_unref (result.invalid); result.invalid = NULL; - g_ptr_array_free (result.contacts, TRUE); + g_ptr_array_unref (result.contacts); result.contacts = NULL; g_assert (result.error == NULL); @@ -520,7 +520,7 @@ test_upgrade (Fixture *f, /* remaining cleanup */ g_main_loop_unref (result.loop); - g_ptr_array_free (result.contacts, TRUE); + g_ptr_array_unref (result.contacts); g_assert (result.invalid == NULL); g_assert (result.error == NULL); } @@ -778,8 +778,8 @@ test_features (Fixture *f, /* remaining cleanup */ g_main_loop_unref (result.loop); - g_array_free (result.invalid, TRUE); - g_ptr_array_free (result.contacts, TRUE); + g_array_unref (result.invalid); + g_ptr_array_unref (result.contacts); g_assert (result.error == NULL); } @@ -888,11 +888,11 @@ test_by_id (Fixture *f, e = g_hash_table_lookup (result.bad_ids, "Not valid"); MYASSERT (e != NULL, ""); - g_ptr_array_free (result.contacts, TRUE); + g_ptr_array_unref (result.contacts); result.contacts = NULL; g_strfreev (result.good_ids); result.good_ids = NULL; - g_hash_table_destroy (result.bad_ids); + g_hash_table_unref (result.bad_ids); result.bad_ids = NULL; g_message ("%s: all good", G_STRFUNC); @@ -924,11 +924,11 @@ test_by_id (Fixture *f, g_object_unref (contacts[i]); } - g_ptr_array_free (result.contacts, TRUE); + g_ptr_array_unref (result.contacts); result.contacts = NULL; g_strfreev (result.good_ids); result.good_ids = NULL; - g_hash_table_destroy (result.bad_ids); + g_hash_table_unref (result.bad_ids); result.bad_ids = NULL; g_message ("%s: not all good", G_STRFUNC); @@ -978,11 +978,11 @@ test_by_id (Fixture *f, /* remaining cleanup */ g_main_loop_unref (result.loop); - g_ptr_array_free (result.contacts, TRUE); + g_ptr_array_unref (result.contacts); result.contacts = NULL; g_strfreev (result.good_ids); result.good_ids = NULL; - g_hash_table_destroy (result.bad_ids); + g_hash_table_unref (result.bad_ids); result.bad_ids = NULL; } diff --git a/tests/dbus/dbus.c b/tests/dbus/dbus.c index da7525fb6..ef95fb8fb 100644 --- a/tests/dbus/dbus.c +++ b/tests/dbus/dbus.c @@ -229,7 +229,7 @@ test_watch_name_owner (void) g_free (events->pdata[i]); } - g_ptr_array_free (events, TRUE); + g_ptr_array_unref (events); g_main_loop_unref (mainloop); mainloop = NULL; } diff --git a/tests/dbus/example-no-protocols.c b/tests/dbus/example-no-protocols.c index 321c8afc6..8d885a21c 100644 --- a/tests/dbus/example-no-protocols.c +++ b/tests/dbus/example-no-protocols.c @@ -63,7 +63,7 @@ connection_manager_got_info (TpConnectionManager *cm, g_main_loop_quit (mainloop); - g_hash_table_destroy (empty); + g_hash_table_unref (empty); } static void diff --git a/tests/dbus/file-transfer-channel.c b/tests/dbus/file-transfer-channel.c index cd668abd0..f1b7376a9 100644 --- a/tests/dbus/file-transfer-channel.c +++ b/tests/dbus/file-transfer-channel.c @@ -125,7 +125,7 @@ static void destroy_socket_control_list (gpointer data) { GArray *tab = data; - g_array_free (tab, TRUE); + g_array_unref (tab); } static GHashTable * diff --git a/tests/dbus/group-mixin.c b/tests/dbus/group-mixin.c index feeb26051..40f19566d 100644 --- a/tests/dbus/group-mixin.c +++ b/tests/dbus/group-mixin.c @@ -302,7 +302,7 @@ check_incoming_invitation (void) MYASSERT (!outstanding_signals (), ": MembersChanged and MembersChangedDetailed should have fired once"); - g_array_free (contacts, TRUE); + g_array_unref (contacts); } } @@ -480,7 +480,7 @@ in_the_desert (void) MYASSERT (a == self_handle || b == self_handle, ""); MYASSERT (a == camel2 || b == camel2, ""); - g_array_free (service_members, TRUE); + g_array_unref (service_members); } tp_handle_unref (contact_repo, camel); diff --git a/tests/dbus/message-mixin.c b/tests/dbus/message-mixin.c index 2d499c316..f57fc52e3 100644 --- a/tests/dbus/message-mixin.c +++ b/tests/dbus/message-mixin.c @@ -286,7 +286,7 @@ main (int argc, request, &chan_path, NULL, &error, NULL); g_assert_no_error (error); - g_hash_table_destroy (request); + g_hash_table_unref (request); } chan = tp_channel_new (conn, chan_path, TP_IFACE_CHANNEL_TYPE_TEXT, @@ -361,7 +361,7 @@ main (int argc, "DeliveryReportingSupport", NULL), ==, TP_DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES); - g_hash_table_destroy (properties); + g_hash_table_unref (properties); } /* Send three messages using the old Text API: @@ -575,9 +575,9 @@ main (int argc, g_free (token); for (i = 0; i < send_parts->len; i++) - g_hash_table_destroy (g_ptr_array_index (send_parts, i)); + g_hash_table_unref (g_ptr_array_index (send_parts, i)); - g_ptr_array_free (send_parts, TRUE); + g_ptr_array_unref (send_parts); } MYASSERT (sent_count == 1, ": %u != 1", sent_count); @@ -684,9 +684,9 @@ main (int argc, g_free (token); for (i = 0; i < send_parts->len; i++) - g_hash_table_destroy (g_ptr_array_index (send_parts, i)); + g_hash_table_unref (g_ptr_array_index (send_parts, i)); - g_ptr_array_free (send_parts, TRUE); + g_ptr_array_unref (send_parts); } MYASSERT (sent_count == 1, ": %u != 1", sent_count); @@ -777,9 +777,9 @@ main (int argc, g_free (token); for (i = 0; i < send_parts->len; i++) - g_hash_table_destroy (g_ptr_array_index (send_parts, i)); + g_hash_table_unref (g_ptr_array_index (send_parts, i)); - g_ptr_array_free (send_parts, TRUE); + g_ptr_array_unref (send_parts); } MYASSERT (sent_count == 1, ": %u != 1", sent_count); @@ -874,9 +874,9 @@ main (int argc, g_free (token); for (i = 0; i < send_parts->len; i++) - g_hash_table_destroy (g_ptr_array_index (send_parts, i)); + g_hash_table_unref (g_ptr_array_index (send_parts, i)); - g_ptr_array_free (send_parts, TRUE); + g_ptr_array_unref (send_parts); } MYASSERT (sent_count == 1, ": %u != 1", sent_count); @@ -926,7 +926,7 @@ main (int argc, g_hash_table_size (ret)); g_hash_table_foreach (ret, print_part_content, NULL); - g_hash_table_destroy (ret); + g_hash_table_unref (ret); i = 47; g_array_append_val (part_numbers, i); @@ -939,7 +939,7 @@ main (int argc, g_error_free (error); error = NULL; - g_array_free (part_numbers, TRUE); + g_array_unref (part_numbers); } g_print ("\n\n==== Listing messages ====\n"); @@ -977,7 +977,7 @@ main (int argc, g_error_free (error); error = NULL; - g_array_free (ids, TRUE); + g_array_unref (ids); /* The test "Acknowledging one message", will fail if the * last_received_id was acknowledged despite the error */ @@ -1037,7 +1037,7 @@ main (int argc, } } - g_hash_table_destroy (properties); + g_hash_table_unref (properties); } g_print ("\n\n==== Acknowledging one message ====\n"); @@ -1057,7 +1057,7 @@ main (int argc, msgid, &error, NULL); g_assert_no_error (error); - g_array_free (msgid, TRUE); + g_array_unref (msgid); } g_print ("\n\n==== Acknowledging all remaining messages using deprecated " diff --git a/tests/dbus/params-cm.c b/tests/dbus/params-cm.c index 280b853ed..193fafca4 100644 --- a/tests/dbus/params-cm.c +++ b/tests/dbus/params-cm.c @@ -172,8 +172,8 @@ test_set_params (Test *test, g_assert (!tp_strdiff (params->uc_string, "FILTER ME")); tp_tests_param_connection_manager_free_params (params); - g_hash_table_destroy (parameters); - g_array_free (array_of_bytes, TRUE); + g_hash_table_unref (parameters); + g_array_unref (array_of_bytes); } static void @@ -201,7 +201,7 @@ test_defaults (Test *test, g_assert_cmpint (params->a_int32, ==, 42); tp_tests_param_connection_manager_free_params (params); - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); } static void @@ -228,7 +228,7 @@ test_missing_required (Test *test, tp_tests_param_connection_manager_free_params (params); } - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); } static void @@ -261,7 +261,7 @@ test_fail_filter (Test *test, tp_tests_param_connection_manager_free_params (params); } - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); } static void @@ -290,7 +290,7 @@ test_wrong_type (Test *test, tp_tests_param_connection_manager_free_params (params); } - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); } static void @@ -321,7 +321,7 @@ test_unwelcome (Test *test, tp_tests_param_connection_manager_free_params (params); } - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); } static void diff --git a/tests/dbus/properties.c b/tests/dbus/properties.c index 3493012f5..427ec900e 100644 --- a/tests/dbus/properties.c +++ b/tests/dbus/properties.c @@ -158,7 +158,7 @@ test_get_all (TpProxy *proxy) g_assert (G_VALUE_HOLDS_UINT (value)); g_assert_cmpuint (g_value_get_uint (value), ==, 42); - g_hash_table_destroy (hash); + g_hash_table_unref (hash); } static void diff --git a/tests/dbus/self-presence.c b/tests/dbus/self-presence.c index 0b9233271..d4c4e8690 100644 --- a/tests/dbus/self-presence.c +++ b/tests/dbus/self-presence.c @@ -209,11 +209,11 @@ test_complex_presence (TpTestsContactsConnection *service_conn, client_conn, -1, monster, &error, NULL), ""); g_assert_no_error (error); - g_hash_table_destroy (params); + g_hash_table_unref (params); params = NULL; - g_hash_table_destroy (monster); + g_hash_table_unref (monster); monster = NULL; - g_hash_table_destroy (statuses); + g_hash_table_unref (statuses); statuses = NULL; } diff --git a/tests/dbus/simple-approver.c b/tests/dbus/simple-approver.c index 1cd725e17..7cac3b128 100644 --- a/tests/dbus/simple-approver.c +++ b/tests/dbus/simple-approver.c @@ -383,7 +383,7 @@ call_add_dispatch (Test *test) g_main_loop_run (test->mainloop); g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); + g_ptr_array_unref (channels); g_hash_table_unref (properties); } diff --git a/tests/dbus/simple-handler.c b/tests/dbus/simple-handler.c index 211c3e512..3719e1a27 100644 --- a/tests/dbus/simple-handler.c +++ b/tests/dbus/simple-handler.c @@ -400,8 +400,8 @@ call_handle_channels (Test *test) } g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); - g_ptr_array_free (requests_satisified, TRUE); + g_ptr_array_unref (channels); + g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } diff --git a/tests/dbus/simple-observer.c b/tests/dbus/simple-observer.c index 1d0abb293..09c893a11 100644 --- a/tests/dbus/simple-observer.c +++ b/tests/dbus/simple-observer.c @@ -366,8 +366,8 @@ call_observe_channels (Test *test) g_main_loop_run (test->mainloop); g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); - g_ptr_array_free (requests_satisified, TRUE); + g_ptr_array_unref (channels); + g_ptr_array_unref (requests_satisified); g_hash_table_unref (info); } diff --git a/tests/dbus/stream-tube.c b/tests/dbus/stream-tube.c index 1577b9522..239ae9335 100644 --- a/tests/dbus/stream-tube.c +++ b/tests/dbus/stream-tube.c @@ -118,7 +118,7 @@ static void destroy_socket_control_list (gpointer data) { GArray *tab = data; - g_array_free (tab, TRUE); + g_array_unref (tab); } static GHashTable * diff --git a/tests/dbus/text-mixin.c b/tests/dbus/text-mixin.c index 2c3a54bac..0f012e0bf 100644 --- a/tests/dbus/text-mixin.c +++ b/tests/dbus/text-mixin.c @@ -250,7 +250,7 @@ main (int argc, g_error_free (error); error = NULL; - g_array_free (ids, TRUE); + g_array_unref (ids); /* The next test, "Acknowledging one message", will fail if the * last_received_id was acknowledged despite the error */ @@ -267,7 +267,7 @@ main (int argc, ids, &error, NULL); g_assert_no_error (error); - g_array_free (ids, TRUE); + g_array_unref (ids); } g_print ("\n\n==== Acknowledging all remaining messages using deprecated " diff --git a/tests/intset.c b/tests/intset.c index 33a800dc4..df770a7fb 100644 --- a/tests/intset.c +++ b/tests/intset.c @@ -196,7 +196,7 @@ int main (int argc, char **argv) arr = tp_intset_to_array (a); tmp = tp_intset_from_array (arr); g_assert (tp_intset_is_equal (a, tmp)); - g_array_free (arr, TRUE); + g_array_unref (arr); tp_intset_destroy (tmp); arr = NULL; tmp = NULL; @@ -204,7 +204,7 @@ int main (int argc, char **argv) arr = tp_intset_to_array (b); tmp = tp_intset_from_array (arr); g_assert (tp_intset_is_equal (b, tmp)); - g_array_free (arr, TRUE); + g_array_unref (arr); tp_intset_destroy (tmp); arr = NULL; tmp = NULL; diff --git a/tests/lib/bug-19101-conn.c b/tests/lib/bug-19101-conn.c index 6f06fe9f0..b0ddc44c3 100644 --- a/tests/lib/bug-19101-conn.c +++ b/tests/lib/bug-19101-conn.c @@ -66,7 +66,7 @@ tp_tests_bug19101_connection_get_contact_attributes ( DEBUG ("called; returning rubbish"); result = g_hash_table_new_full (NULL, NULL, NULL, - (GDestroyNotify) g_hash_table_destroy); + (GDestroyNotify) g_hash_table_unref); for (i = 0 ; i < handles->len ; i++) { diff --git a/tests/lib/contacts-conn.c b/tests/lib/contacts-conn.c index 1d1b5ee1c..8c187ffd1 100644 --- a/tests/lib/contacts-conn.c +++ b/tests/lib/contacts-conn.c @@ -169,13 +169,13 @@ finalize (GObject *object) TpTestsContactsConnection *self = TP_TESTS_CONTACTS_CONNECTION (object); tp_contacts_mixin_finalize (object); - g_hash_table_destroy (self->priv->aliases); - g_hash_table_destroy (self->priv->avatars); - g_hash_table_destroy (self->priv->presence_statuses); - g_hash_table_destroy (self->priv->presence_messages); - g_hash_table_destroy (self->priv->locations); - g_hash_table_destroy (self->priv->capabilities); - g_hash_table_destroy (self->priv->contact_info); + g_hash_table_unref (self->priv->aliases); + g_hash_table_unref (self->priv->avatars); + g_hash_table_unref (self->priv->presence_statuses); + g_hash_table_unref (self->priv->presence_messages); + g_hash_table_unref (self->priv->locations); + g_hash_table_unref (self->priv->capabilities); + g_hash_table_unref (self->priv->contact_info); if (self->priv->default_contact_info != NULL) g_ptr_array_unref (self->priv->default_contact_info); @@ -460,7 +460,7 @@ my_get_contact_statuses (GObject *object, g_hash_table_insert (result, key, tp_presence_status_new (index, parameters)); - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); } return result; @@ -611,7 +611,7 @@ tp_tests_contacts_connection_change_aliases (TpTestsContactsConnection *self, structs); g_ptr_array_foreach (structs, (GFunc) g_value_array_free, NULL); - g_ptr_array_free (structs, TRUE); + g_ptr_array_unref (structs); } void @@ -648,12 +648,12 @@ tp_tests_contacts_connection_change_presences ( g_hash_table_insert (presences, key, tp_presence_status_new (indexes[i], parameters)); - g_hash_table_destroy (parameters); + g_hash_table_unref (parameters); } tp_presence_mixin_emit_presence_update ((GObject *) self, presences); - g_hash_table_destroy (presences); + g_hash_table_unref (presences); } void @@ -804,7 +804,7 @@ my_get_aliases (TpSvcConnectionInterfaceAliasing *aliasing, tp_svc_connection_interface_aliasing_return_from_get_aliases (context, result); - g_hash_table_destroy (result); + g_hash_table_unref (result); } static void @@ -915,7 +915,7 @@ my_get_avatar_tokens (TpSvcConnectionInterfaceAvatars *avatars, tp_svc_connection_interface_avatars_return_from_get_known_avatar_tokens ( context, result); - g_hash_table_destroy (result); + g_hash_table_unref (result); } static void @@ -955,7 +955,7 @@ my_get_known_avatar_tokens (TpSvcConnectionInterfaceAvatars *avatars, tp_svc_connection_interface_avatars_return_from_get_known_avatar_tokens ( context, result); - g_hash_table_destroy (result); + g_hash_table_unref (result); } static void @@ -1069,7 +1069,7 @@ my_get_locations (TpSvcConnectionInterfaceLocation *avatars, tp_svc_connection_interface_location_return_from_get_locations ( context, result); - g_hash_table_destroy (result); + g_hash_table_unref (result); } static void @@ -1123,7 +1123,7 @@ my_get_contact_capabilities (TpSvcConnectionInterfaceContactCapabilities *obj, tp_svc_connection_interface_contact_capabilities_return_from_get_contact_capabilities ( context, result); - g_hash_table_destroy (result); + g_hash_table_unref (result); } static void diff --git a/tests/lib/echo-im-manager.c b/tests/lib/echo-im-manager.c index c0eafebdb..62cd5c8b5 100644 --- a/tests/lib/echo-im-manager.c +++ b/tests/lib/echo-im-manager.c @@ -161,7 +161,7 @@ tp_tests_echo_im_manager_close_all (TpTestsEchoImManager *self) GHashTable *tmp = self->priv->channels; self->priv->channels = NULL; - g_hash_table_destroy (tmp); + g_hash_table_unref (tmp); } if (self->priv->status_changed_id != 0) @@ -282,7 +282,7 @@ tp_tests_echo_im_manager_foreach_channel_class (TpChannelManager *manager, func (manager, table, allowed_properties, user_data); - g_hash_table_destroy (table); + g_hash_table_unref (table); } static gboolean diff --git a/tests/lib/params-cm.c b/tests/lib/params-cm.c index c8c1199bd..2a615b3b3 100644 --- a/tests/lib/params-cm.c +++ b/tests/lib/params-cm.c @@ -201,7 +201,7 @@ tp_tests_param_connection_manager_free_params (TpTestsCMParams *p) g_free (p->a_string); g_strfreev (p->a_array_of_strings); if (p->a_array_of_bytes != NULL) - g_array_free (p->a_array_of_bytes, TRUE); + g_array_unref (p->a_array_of_bytes); g_free (p->a_object_path); g_slice_free (TpTestsCMParams, p); diff --git a/tests/lib/simple-channel-dispatch-operation.c b/tests/lib/simple-channel-dispatch-operation.c index 796d226de..8588ddfee 100644 --- a/tests/lib/simple-channel-dispatch-operation.c +++ b/tests/lib/simple-channel-dispatch-operation.c @@ -180,7 +180,7 @@ tp_tests_simple_channel_dispatch_operation_finalize (GObject *object) g_free (self->priv->conn_path); g_free (self->priv->account_path); - g_ptr_array_free (self->priv->channels, TRUE); + g_ptr_array_unref (self->priv->channels); if (finalize != NULL) finalize (object); diff --git a/tests/lib/simple-channel-dispatcher.c b/tests/lib/simple-channel-dispatcher.c index 283ec64e2..22bca4b23 100644 --- a/tests/lib/simple-channel-dispatcher.c +++ b/tests/lib/simple-channel-dispatcher.c @@ -99,7 +99,7 @@ create_channel_request (TpTestsSimpleChannelDispatcher *self, self->priv->requests = g_slist_append (self->priv->requests, chan_request); - g_ptr_array_free (requests, TRUE); + g_ptr_array_unref (requests); dbus = tp_dbus_daemon_dup (NULL); g_assert (dbus != NULL); diff --git a/tests/lib/simple-channel-request.c b/tests/lib/simple-channel-request.c index 7085d8a28..09220c8c9 100644 --- a/tests/lib/simple-channel-request.c +++ b/tests/lib/simple-channel-request.c @@ -243,8 +243,8 @@ tp_tests_simple_channel_request_proceed (TpSvcChannelRequest *request, g_free (client_path); g_ptr_array_foreach (channels, free_channel_details, NULL); - g_ptr_array_free (channels, TRUE); - g_ptr_array_free (satisfied, TRUE); + g_ptr_array_unref (channels); + g_ptr_array_unref (satisfied); g_hash_table_unref (info); g_hash_table_unref (request_props); g_object_unref (dbus); diff --git a/tests/lib/util.c b/tests/lib/util.c index b83cd5192..648be0293 100644 --- a/tests/lib/util.c +++ b/tests/lib/util.c @@ -349,7 +349,7 @@ void _tp_destroy_socket_control_list (gpointer data) { GArray *tab = data; - g_array_free (tab, TRUE); + g_array_unref (tab); } GValue * diff --git a/tests/util.c b/tests/util.c index 081a51b50..7c1d08689 100644 --- a/tests/util.c +++ b/tests/util.c @@ -301,7 +301,7 @@ int main (int argc, char **argv) g_assert (tp_g_ptr_array_contains (ptrarray, GINT_TO_POINTER (23))); g_assert (tp_g_ptr_array_contains (ptrarray, GINT_TO_POINTER (42))); g_assert (!tp_g_ptr_array_contains (ptrarray, GINT_TO_POINTER (666))); - g_ptr_array_free (ptrarray, TRUE); + g_ptr_array_unref (ptrarray); string = tp_escape_as_identifier (""); g_assert (!tp_strdiff (string, "_")); |