static gboolean kms_connection_ext_add_answer_attributes (KmsISdpMediaExtension * ext, const GstSDPMedia * offer, GstSDPMedia * answer, GError ** error) { GArray *ips_offered, *ips_answered; ips_offered = g_array_sized_new (FALSE, FALSE, sizeof (GValue), KMS_RESERVED_CONNECTION_SIZE); ips_answered = g_array_sized_new (FALSE, FALSE, sizeof (GValue), KMS_RESERVED_CONNECTION_SIZE); g_array_set_clear_func (ips_offered, (GDestroyNotify) g_value_unset); g_array_set_clear_func (ips_answered, (GDestroyNotify) g_value_unset); kms_connection_ext_get_connection_attrs (ext, offer, ips_offered); g_signal_emit (G_OBJECT (ext), obj_signals[SIGNAL_ON_ANSWER_IPS], 0, ips_offered, ips_answered); kms_connection_attr_ext_add_ips (ext, answer, ips_answered); g_array_unref (ips_offered); g_array_unref (ips_answered); return TRUE; }
static void nm_fake_platform_finalize (GObject *object) { NMFakePlatformPrivate *priv = NM_FAKE_PLATFORM_GET_PRIVATE (object); int i; GSList *iter; for (iter = priv->link_added_ids; iter; iter = iter->next) g_source_remove (GPOINTER_TO_UINT (iter->data)); g_slist_free (priv->link_added_ids); g_hash_table_unref (priv->options); for (i = 0; i < priv->links->len; i++) { NMFakePlatformLink *device = &g_array_index (priv->links, NMFakePlatformLink, i); g_bytes_unref (device->address); g_free (device->udi); } g_array_unref (priv->links); g_array_unref (priv->ip4_addresses); g_array_unref (priv->ip6_addresses); g_array_unref (priv->ip4_routes); g_array_unref (priv->ip6_routes); G_OBJECT_CLASS (nm_fake_platform_parent_class)->finalize (object); }
static void arguments_free(GArray *in_args, GArray *out_args, GPtrArray *args_metadata) { guint i; for (i = 0; i < args_metadata->len; i++) { RBGIArgMetadata *metadata; gint in_arg_index; metadata = g_ptr_array_index(args_metadata, i); if (metadata->direction == GI_DIRECTION_IN || metadata->direction == GI_DIRECTION_INOUT) { in_arg_index = metadata->in_arg_index; if (in_arg_index != -1) { GIArgument *argument; argument = &(g_array_index(in_args, GIArgument, in_arg_index)); rb_gi_in_argument_free(argument, &(metadata->arg_info)); } } else { GIArgument *argument; argument = &(g_array_index(out_args, GIArgument, metadata->out_arg_index)); rb_gi_out_argument_fin(argument, &(metadata->arg_info)); } } g_array_unref(in_args); g_array_unref(out_args); g_ptr_array_unref(args_metadata); }
static void dump_info(GstVaapiDisplay *display) { GArray *profiles, *formats; profiles = gst_vaapi_display_get_decode_profiles(display); if (!profiles) g_error("could not get VA decode profiles"); print_profiles(profiles, "decoders"); g_array_unref(profiles); profiles = gst_vaapi_display_get_encode_profiles(display); if (!profiles) g_error("could not get VA encode profiles"); print_profiles(profiles, "encoders"); g_array_unref(profiles); formats = gst_vaapi_display_get_image_formats(display); if (!formats) g_error("could not get VA image formats"); print_formats(formats, "image"); g_array_unref(formats); formats = gst_vaapi_display_get_subpicture_formats(display); if (!formats) g_error("could not get VA subpicture formats"); print_formats(formats, "subpicture"); g_array_unref(formats); dump_properties(display); }
static gboolean gst_vaapidecode_ensure_allowed_sinkpad_caps (GstVaapiDecode * decode) { GstCaps *caps, *allowed_sinkpad_caps; GArray *profiles; guint i; profiles = gst_vaapi_display_get_decode_profiles (GST_VAAPI_PLUGIN_BASE_DISPLAY (decode)); if (!profiles) goto error_no_profiles; allowed_sinkpad_caps = gst_caps_new_empty (); if (!allowed_sinkpad_caps) goto error_no_memory; for (i = 0; i < profiles->len; i++) { const GstVaapiProfile profile = g_array_index (profiles, GstVaapiProfile, i); const gchar *media_type_name; const gchar *profile_name; GstStructure *structure; media_type_name = gst_vaapi_profile_get_media_type_name (profile); if (!media_type_name) continue; caps = gst_caps_from_string (media_type_name); if (!caps) continue; structure = gst_caps_get_structure (caps, 0); profile_name = gst_vaapi_profile_get_name (profile); if (profile_name) gst_structure_set (structure, "profile", G_TYPE_STRING, profile_name, NULL); allowed_sinkpad_caps = gst_caps_merge (allowed_sinkpad_caps, caps); } decode->allowed_sinkpad_caps = gst_caps_simplify (allowed_sinkpad_caps); g_array_unref (profiles); return TRUE; /* ERRORS */ error_no_profiles: { GST_ERROR ("failed to retrieve VA decode profiles"); return FALSE; } error_no_memory: { GST_ERROR ("failed to allocate allowed-caps set"); g_array_unref (profiles); return FALSE; } }
static void gst_wl_display_finalize (GObject * gobject) { GstWlDisplay *self = GST_WL_DISPLAY (gobject); gst_poll_set_flushing (self->wl_fd_poll, TRUE); if (self->thread) g_thread_join (self->thread); /* to avoid buffers being unregistered from another thread * at the same time, take their ownership */ g_mutex_lock (&self->buffers_mutex); self->shutting_down = TRUE; g_hash_table_foreach (self->buffers, (GHFunc) g_object_ref, NULL); g_mutex_unlock (&self->buffers_mutex); g_hash_table_foreach (self->buffers, (GHFunc) gst_wl_buffer_force_release_and_unref, NULL); g_hash_table_remove_all (self->buffers); g_array_unref (self->shm_formats); g_array_unref (self->dmabuf_formats); gst_poll_free (self->wl_fd_poll); g_hash_table_unref (self->buffers); g_mutex_clear (&self->buffers_mutex); if (self->viewporter) wp_viewporter_destroy (self->viewporter); if (self->shm) wl_shm_destroy (self->shm); if (self->dmabuf) zwp_linux_dmabuf_v1_destroy (self->dmabuf); if (self->shell) wl_shell_destroy (self->shell); if (self->compositor) wl_compositor_destroy (self->compositor); if (self->subcompositor) wl_subcompositor_destroy (self->subcompositor); if (self->registry) wl_registry_destroy (self->registry); if (self->queue) wl_event_queue_destroy (self->queue); if (self->own_display) { wl_display_flush (self->display); wl_display_disconnect (self->display); } G_OBJECT_CLASS (gst_wl_display_parent_class)->finalize (gobject); }
static void storage_context_free (StorageContext *ctx) { if (ctx->supported_mem1) g_array_unref (ctx->supported_mem1); if (ctx->supported_mem2) g_array_unref (ctx->supported_mem2); if (ctx->supported_mem3) g_array_unref (ctx->supported_mem3); g_free (ctx); }
static void parent_load_supported_modes_ready (MMIfaceModem *self, GAsyncResult *res, GSimpleAsyncResult *simple) { GError *error = NULL; GArray *all; GArray *combinations; GArray *filtered; MMModemModeCombination mode; all = iface_modem_parent->load_supported_modes_finish (self, res, &error); if (!all) { g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (simple); return; } /* Build list of combinations */ combinations = g_array_sized_new (FALSE, FALSE, sizeof (MMModemModeCombination), 5); /* 2G only */ mode.allowed = MM_MODEM_MODE_2G; mode.preferred = MM_MODEM_MODE_NONE; g_array_append_val (combinations, mode); /* 3G only */ mode.allowed = MM_MODEM_MODE_3G; mode.preferred = MM_MODEM_MODE_NONE; g_array_append_val (combinations, mode); /* 2G and 3G */ mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); mode.preferred = MM_MODEM_MODE_NONE; g_array_append_val (combinations, mode); /* 2G and 3G, 2G preferred */ mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); mode.preferred = MM_MODEM_MODE_2G; g_array_append_val (combinations, mode); /* 2G and 3G, 3G preferred */ mode.allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); mode.preferred = MM_MODEM_MODE_3G; g_array_append_val (combinations, mode); /* Filter out those unsupported modes */ filtered = mm_filter_supported_modes (all, combinations); g_array_unref (all); g_array_unref (combinations); g_simple_async_result_set_op_res_gpointer (simple, filtered, (GDestroyNotify) g_array_unref); g_simple_async_result_complete (simple); g_object_unref (simple); }
/** * cd_interp_finalize: **/ static void cd_interp_finalize (GObject *object) { CdInterp *interp = CD_INTERP (object); CdInterpPrivate *priv = GET_PRIVATE (interp); g_return_if_fail (CD_IS_INTERP (object)); g_array_unref (priv->x); g_array_unref (priv->y); G_OBJECT_CLASS (cd_interp_parent_class)->finalize (object); }
static void remove_not_supported_codecs (GstElement *element) { GArray *codecs; g_object_get (element, "audio-codecs", &codecs, NULL); remove_not_supported_codecs_from_array (element, codecs); g_array_unref (codecs); g_object_get (element, "video-codecs", &codecs, NULL); remove_not_supported_codecs_from_array (element, codecs); g_array_unref (codecs); }
static void finalize(GObject *obj) { RobotObjFile *self = ROBOT_OBJ_FILE(obj); g_byte_array_unref(self->data); g_byte_array_unref(self->text); g_array_unref(self->sym); g_array_unref(self->relocation); g_array_unref(self->depends); self->data = NULL; self->text = NULL; self->sym = NULL; self->relocation = NULL; self->depends = NULL; }
NMIP6Config * nm_ip6_config_new_for_interface (int ifindex) { NMIP6Config *ip6; GArray *addrs_array, *routes_array; NMPlatformIP6Address *addrs; NMPlatformIP6Route *routes; NMIP6Address *addr; NMIP6Route *route; int i; addrs_array = nm_platform_ip6_address_get_all (ifindex); if (addrs_array->len == 0) { g_array_unref (addrs_array); return NULL; } ip6 = nm_ip6_config_new (); addrs = (NMPlatformIP6Address *)addrs_array->data; for (i = 0; i < addrs_array->len; i++) { addr = nm_ip6_address_new (); nm_ip6_address_set_address (addr, &addrs[i].address); nm_ip6_address_set_prefix (addr, addrs[i].plen); nm_ip6_config_take_address (ip6, addr); } g_array_unref (addrs_array); routes_array = nm_platform_ip6_route_get_all (ifindex); routes = (NMPlatformIP6Route *)routes_array->data; for (i = 0; i < routes_array->len; i++) { /* Default route ignored; it's handled internally by NM and not * tracked in the device's IP config. */ if (routes[i].plen == 0) continue; route = nm_ip6_route_new (); nm_ip6_route_set_dest (route, &routes[i].network); nm_ip6_route_set_prefix (route, routes[i].plen); nm_ip6_route_set_next_hop (route, &routes[i].gateway); nm_ip6_route_set_metric (route, routes[i].metric); nm_ip6_config_take_route (ip6, route); } g_array_unref (routes_array); return ip6; }
/* This function takes ownership of handles array */ static void tp_contact_list_group_add (EmpathyTpContactList *list, const gchar *group_name, GArray *handles) { EmpathyTpContactListPriv *priv = GET_PRIV (list); TpChannel *channel; const gchar *names[] = {group_name, NULL}; /* Search the channel for that group name */ channel = g_hash_table_lookup (priv->groups, group_name); if (channel) { tp_cli_channel_interface_group_call_add_members (channel, -1, handles, NULL, NULL, NULL, NULL, NULL); g_array_unref (handles); return; } /* That group does not exist yet, we have to: * 1) Request an handle for the group name * 2) Request a channel * 3) When NewChannel is emitted, add handles in members */ g_hash_table_insert (priv->add_to_group, g_strdup (group_name), handles); tp_cli_connection_call_request_handles (priv->connection, -1, TP_HANDLE_TYPE_GROUP, names, tp_contact_list_group_request_handles_cb, NULL, NULL, G_OBJECT (list)); }
static void ip4_dns_parser (NMSetting *setting, const char *key, GKeyFile *keyfile, const char *keyfile_path) { const char *setting_name = nm_setting_get_name (setting); GArray *array = NULL; gsize length; char **list, **iter; int ret; list = g_key_file_get_string_list (keyfile, setting_name, key, &length, NULL); if (!list || !g_strv_length (list)) return; array = g_array_sized_new (FALSE, FALSE, sizeof (guint32), length); for (iter = list; *iter; iter++) { struct in_addr addr; ret = inet_pton (AF_INET, *iter, &addr); if (ret <= 0) { g_warning ("%s: ignoring invalid DNS server address '%s'", __func__, *iter); continue; } g_array_append_val (array, addr.s_addr); } g_strfreev (list); if (array) { g_object_set (setting, key, array, NULL); g_array_unref (array); } }
static void bluesky_cleaner_item_free(BlueSkyCleanerItem *item) { if (item == NULL) return; g_array_unref(item->links); g_free(item); }
void gdk_wayland_selection_free (GdkWaylandSelection *selection) { gint i; for (i = 0; i < G_N_ELEMENTS (selection->selections); i++) g_hash_table_destroy (selection->selections[i].buffers); g_array_unref (selection->source_targets); g_hash_table_destroy (selection->offers); g_free (selection->stored_selection.data); if (selection->stored_selection.cancellable) { g_cancellable_cancel (selection->stored_selection.cancellable); g_object_unref (selection->stored_selection.cancellable); } if (selection->stored_selection.fd > 0) close (selection->stored_selection.fd); if (selection->primary_source) gtk_primary_selection_source_destroy (selection->primary_source); if (selection->clipboard_source) wl_data_source_destroy (selection->clipboard_source); if (selection->dnd_source) wl_data_source_destroy (selection->dnd_source); g_free (selection); }
static gboolean gom_resource_do_delete (GomResource *resource, GomAdapter *adapter, GError **error) { GomCommandBuilder *builder; GType resource_type; g_return_val_if_fail(GOM_IS_RESOURCE(resource), FALSE); g_return_val_if_fail(GOM_IS_ADAPTER(adapter), FALSE); resource_type = G_TYPE_FROM_INSTANCE(resource); builder = g_object_new(GOM_TYPE_COMMAND_BUILDER, "adapter", adapter, NULL); do { GomResourceClass *klass; GParamSpec *pspec; GomCommand *command; GomFilter *filter; GArray *values; GValue value = { 0 }; gchar *sql; klass = g_type_class_peek(resource_type); g_assert(GOM_IS_RESOURCE_CLASS(klass)); pspec = g_object_class_find_property(G_OBJECT_CLASS(klass), klass->primary_key); g_assert(pspec); g_value_init(&value, pspec->value_type); g_object_get_property(G_OBJECT(resource), klass->primary_key, &value); sql = g_strdup_printf("'%s'.'%s' = ?", klass->table, klass->primary_key); values = g_array_sized_new(FALSE, FALSE, sizeof(GValue), 1); g_array_append_val(values, value); filter = gom_filter_new_sql(sql, values); g_free(sql); memset(&value, 0, sizeof value); g_array_unref(values); g_object_set(builder, "filter", filter, "resource-type", resource_type, NULL); g_object_unref(filter); command = gom_command_builder_build_delete(builder); if (!gom_command_execute(command, NULL, error)) { g_object_unref(command); g_object_unref(builder); return FALSE; } g_object_unref(command); } while ((resource_type = g_type_parent(resource_type)) != GOM_TYPE_RESOURCE); g_object_unref(builder); return TRUE; }
/** * tp_connection_get_contact_attributes: * @self: a connection * @timeout_ms: the timeout in milliseconds, or -1 to use the default * @n_handles: the number of handles in @handles (must be at least 1) * @handles: (array length=n_handles): an array of handles * @interfaces: a #GStrv of interfaces * @hold: if %TRUE, the callback will hold one reference to each valid handle * @callback: (type GObject.Callback): called on success or * failure (unless @weak_object has become unreferenced) * @user_data: arbitrary user-supplied data * @destroy: called to destroy @user_data after calling @callback, or when * @weak_object becomes unreferenced (whichever occurs sooner) * @weak_object: if not %NULL, an object to be weakly referenced: if it is * destroyed, @callback will not be called * * Return (via a callback) any number of attributes of the given handles. * * Since telepathy-glib version 0.13.8, * the handles will remain valid until @connection becomes invalid * (signalled by #TpProxy::invalidated). In earlier versions, if @hold * was %TRUE, the callback would hold a reference to them which could be * released with tp_connection_unref_handles(). * * This is a thin wrapper around the GetContactAttributes D-Bus method, and * should be used in preference to * tp_cli_connection_interface_contacts_call_get_contact_attributes(); mixing this * function, tp_connection_hold_handles(), tp_connection_unref_handles(), and * #TpContact with direct use of the RequestHandles, HoldHandles and * GetContactAttributes D-Bus methods is unwise, as #TpConnection and * #TpContact perform client-side reference counting of handles. * The #TpContact API provides a higher-level abstraction which should * usually be used instead. * * @callback will later be called with the attributes of those of the given * handles that were valid. Invalid handles are simply omitted from the * parameter to the callback. * * If @hold is %TRUE, the @callback is given one reference to each handle * that appears as a key in the callback's @attributes parameter. * * Deprecated: Use tp_simple_client_factory_ensure_contact() instead. */ void tp_connection_get_contact_attributes (TpConnection *self, gint timeout_ms, guint n_handles, const TpHandle *handles, const gchar * const *interfaces, gboolean hold, tp_cli_connection_interface_contacts_callback_for_get_contact_attributes callback, gpointer user_data, GDestroyNotify destroy, GObject *weak_object) { GArray *a; guint i; DEBUG ("%u handles", n_handles); for (i = 0; i < n_handles; i++) DEBUG ("- %u", handles[i]); g_return_if_fail (TP_IS_CONNECTION (self)); g_return_if_fail (n_handles >= 1); g_return_if_fail (handles != NULL); g_return_if_fail (callback != NULL); a = g_array_sized_new (FALSE, FALSE, sizeof (guint), n_handles); g_array_append_vals (a, handles, n_handles); /* We ignore @hold, and always hold the handles anyway */ tp_cli_connection_interface_contacts_call_get_contact_attributes (self, -1, a, (const gchar **) interfaces, TRUE, callback, user_data, destroy, weak_object); g_array_unref (a); }
static int tids_destructor(void *object) { TIDS_INSTANCE *tids = talloc_get_type_abort(object, TIDS_INSTANCE); if (tids->pids) g_array_unref(tids->pids); return 0; }
static void _recent_file_tile_remove_clicked_cb (PengeInterestingTile *tile, gpointer userdata) { PengeEverythingPane *pane = (PengeEverythingPane *)userdata; PengeEverythingPanePrivate *priv = GET_PRIVATE (pane); ZeitgeistEvent *event; GArray *event_ids; guint32 id; g_object_get (tile, "zg-event", &event, NULL); event_ids = g_array_sized_new (FALSE, FALSE, sizeof(guint32), 1); id = zeitgeist_event_get_id (event); g_array_append_val (event_ids, id); zeitgeist_log_delete_events (priv->recent_log, event_ids, NULL, _zeitgeist_log_delete_events_received, tile); g_array_unref (event_ids); }
static void eos_shard_writer_v1_finalize (GObject *object) { EosShardWriterV1 *self = EOS_SHARD_WRITER_V1 (object); g_array_unref (self->entries); G_OBJECT_CLASS (eos_shard_writer_v1_parent_class)->finalize (object); }
static void add_to_members (EmpathyTpContactList *list, GArray *handles) { EmpathyTpContactListPriv *priv = GET_PRIV (list); GArray *request; guint i; if (handles->len == 0) return; request = g_array_new (FALSE, FALSE, sizeof (TpHandle)); for (i = 0; i < handles->len; i++) { TpHandle handle = g_array_index (handles, TpHandle, i); if (g_hash_table_lookup (priv->members, GUINT_TO_POINTER (handle))) continue; g_array_append_val (request, handle); } if (request->len > 0) { empathy_tp_contact_factory_get_from_handles (priv->connection, request->len, (TpHandle *) request->data, got_added_members_cb, NULL, NULL, G_OBJECT (list)); } g_array_unref (request); }
static void gum_darwin_enumerate_modules_slow (mach_port_t task, GumFoundModuleFunc func, gpointer user_data) { GumEnumerateModulesSlowContext ctx; guint i; ctx.task = task; ctx.func = func; ctx.user_data = user_data; ctx.ranges = g_array_sized_new (FALSE, FALSE, sizeof (GumMemoryRange), 64); ctx.alignment = 4096; gum_darwin_enumerate_ranges (task, GUM_PAGE_RX, gum_store_range_of_potential_modules, &ctx); for (i = 0; i != ctx.ranges->len; i++) { GumMemoryRange * r = &g_array_index (ctx.ranges, GumMemoryRange, i); if (!gum_emit_modules_in_range (r, &ctx)) break; } g_array_unref (ctx.ranges); }
static void tp_streamed_media_request_streams_for_capabilities (EmpathyTpStreamedMedia *call, EmpathyCapabilities capabilities) { EmpathyTpStreamedMediaPriv *priv = GET_PRIV (call); GArray *stream_types; guint handle; guint stream_type; if (capabilities == EMPATHY_CAPABILITIES_UNKNOWN) capabilities = EMPATHY_CAPABILITIES_AUDIO | EMPATHY_CAPABILITIES_VIDEO; DEBUG ("Requesting new stream for capabilities %d", capabilities); stream_types = g_array_new (FALSE, FALSE, sizeof (guint)); handle = empathy_contact_get_handle (priv->contact); if (capabilities & EMPATHY_CAPABILITIES_AUDIO) { stream_type = TP_MEDIA_STREAM_TYPE_AUDIO; g_array_append_val (stream_types, stream_type); } if (capabilities & EMPATHY_CAPABILITIES_VIDEO) { stream_type = TP_MEDIA_STREAM_TYPE_VIDEO; g_array_append_val (stream_types, stream_type); } tp_cli_channel_type_streamed_media_call_request_streams (priv->channel, -1, handle, stream_types, tp_streamed_media_request_streams_cb, NULL, NULL, G_OBJECT (call)); g_array_unref (stream_types); }
static void gst_vaapiencode_register (GstPlugin * plugin, GstVaapiDisplay * display) { guint i, j; GArray *codecs; GstVaapiCodec codec; codecs = display_get_encoder_codecs (display); if (!codecs) return; for (i = 0; i < codecs->len; i++) { codec = g_array_index (codecs, GstVaapiCodec, i); for (j = 0; j < G_N_ELEMENTS (vaapi_encode_map); j++) { if (vaapi_encode_map[j].codec == codec) { gst_element_register (plugin, vaapi_encode_map[j].name, vaapi_encode_map[j].rank, vaapi_encode_map[j].get_type ()); break; } } } #if USE_H264_FEI_ENCODER if (gst_vaapi_display_has_encoder (display, GST_VAAPI_PROFILE_H264_MAIN, GST_VAAPI_ENTRYPOINT_SLICE_ENCODE_FEI)) { gst_element_register (plugin, "vaapih264feienc", GST_RANK_SECONDARY, GST_TYPE_VAAPIENCODE_H264_FEI); } #endif g_array_unref (codecs); }
/* Gets a compatible profile for the active codec */ static GstVaapiProfile get_compatible_profile (GstVaapiEncoder * encoder) { const GstVaapiEncoderClassData *const cdata = GST_VAAPI_ENCODER_GET_CLASS (encoder)->class_data; GstVaapiProfile profile; GArray *profiles; guint i; profiles = gst_vaapi_display_get_encode_profiles (encoder->display); if (!profiles) return GST_VAAPI_PROFILE_UNKNOWN; // Pick a profile matching the class codec for (i = 0; i < profiles->len; i++) { profile = g_array_index (profiles, GstVaapiProfile, i); if (gst_vaapi_profile_get_codec (profile) == cdata->codec) break; } if (i == profiles->len) profile = GST_VAAPI_PROFILE_UNKNOWN; g_array_unref (profiles); return profile; }
void gdk_wayland_selection_free (GdkWaylandSelection *selection) { g_hash_table_destroy (selection->selection_buffers); g_array_unref (selection->source_targets); g_hash_table_destroy (selection->offers); g_free (selection->stored_selection.data); if (selection->stored_selection.cancellable) { g_cancellable_cancel (selection->stored_selection.cancellable); g_object_unref (selection->stored_selection.cancellable); } if (selection->stored_selection.fd > 0) close (selection->stored_selection.fd); if (selection->clipboard_source) wl_data_source_destroy (selection->clipboard_source); if (selection->dnd_source) wl_data_source_destroy (selection->dnd_source); g_free (selection); }
static void clutter_paint_node_real_finalize (ClutterPaintNode *node) { ClutterPaintNode *iter; g_free (node->name); if (node->operations != NULL) { guint i; for (i = 0; i < node->operations->len; i++) { ClutterPaintOperation *op; op = &g_array_index (node->operations, ClutterPaintOperation, i); clutter_paint_operation_clear (op); } g_array_unref (node->operations); } iter = node->first_child; while (iter != NULL) { ClutterPaintNode *next = iter->next_sibling; clutter_paint_node_remove_child (node, iter); iter = next; } g_type_free_instance ((GTypeInstance *) node); }
/** * tp_base_call_stream_remove_member: * @self: a #TpBaseCallStream * @contact: the #TpHandle to remove from members * @actor_handle: the contact responsible for the change, or 0 if no contact was * responsible. * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * Remove @contact from stream members, emitting RemoteMembersChanged DBus * signal if needed. Do nothing if @contact is not member. * * Returns: %TRUE if @contact was removed, %FALSE if it was not member. * Since: 0.17.5 */ gboolean tp_base_call_stream_remove_member (TpBaseCallStream *self, TpHandle contact, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { GHashTable *empty_table; GArray *removed_array; GValueArray *reason_array; g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), FALSE); if (!g_hash_table_remove (self->priv->remote_members, GUINT_TO_POINTER (contact))) return FALSE; g_object_notify (G_OBJECT (self), "remote-members"); empty_table = g_hash_table_new (g_direct_hash, g_direct_equal); removed_array = g_array_sized_new (FALSE, TRUE, sizeof (TpHandle), 1); g_array_append_val (removed_array, contact); reason_array = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); tp_svc_call_stream_emit_remote_members_changed (self, empty_table, empty_table, removed_array, reason_array); tp_value_array_free (reason_array); g_hash_table_unref (empty_table); g_array_unref (removed_array); return TRUE; }
/** * tp_base_call_stream_update_remote_sending_state: * @self: a #TpBaseCallStream * @contact: the #TpHandle to update or add to members * @new_state: the new sending state of @contact * @actor_handle: the contact responsible for the change, or 0 if no contact was * responsible. * @reason: the #TpCallStateChangeReason of the change * @dbus_reason: a specific reason for the change, which may be a D-Bus error in * the Telepathy namespace, a D-Bus error in any other namespace (for * implementation-specific errors), or the empty string to indicate that the * state change was not an error. * @message: an optional debug message, to expediate debugging the potentially * many processes involved in a call. * * If @contact is not member, add it. Otherwise update its sending state. Emits * RemoteMemberChanged DBus signal if needed. * * Returns: %TRUE if state was updated, %FALSE if it was already set to * @new_state. * Since: 0.17.5 */ gboolean tp_base_call_stream_update_remote_sending_state (TpBaseCallStream *self, TpHandle contact, TpSendingState new_state, TpHandle actor_handle, TpCallStateChangeReason reason, const gchar *dbus_reason, const gchar *message) { gpointer old_state_p = NULL; TpSendingState old_state; gboolean exists; GHashTable *updates; GHashTable *identifiers; GArray *removed_empty; GValueArray *reason_array; g_return_val_if_fail (TP_IS_BASE_CALL_STREAM (self), FALSE); if (new_state == TP_SENDING_STATE_SENDING && self->priv->channel != NULL && tp_base_channel_is_requested (TP_BASE_CHANNEL (self->priv->channel)) && !tp_base_call_channel_is_accepted (self->priv->channel)) new_state = TP_SENDING_STATE_PENDING_SEND; exists = g_hash_table_lookup_extended (self->priv->remote_members, GUINT_TO_POINTER (contact), NULL, &old_state_p); old_state = GPOINTER_TO_UINT (old_state_p); if (exists && old_state == new_state) return FALSE; DEBUG ("Updating remote member %d state: %d => %d for stream %s", contact, old_state, new_state, self->priv->object_path); g_hash_table_insert (self->priv->remote_members, GUINT_TO_POINTER (contact), GUINT_TO_POINTER (new_state)); g_object_notify (G_OBJECT (self), "remote-members"); updates = g_hash_table_new (g_direct_hash, g_direct_equal); g_hash_table_insert (updates, GUINT_TO_POINTER (contact), GUINT_TO_POINTER (new_state)); identifiers = _tp_base_call_dup_member_identifiers (self->priv->conn, updates); removed_empty = g_array_new (FALSE, FALSE, sizeof (TpHandle)); reason_array = _tp_base_call_state_reason_new (actor_handle, reason, dbus_reason, message); tp_svc_call_stream_emit_remote_members_changed (self, updates, identifiers, removed_empty, reason_array); g_array_unref (removed_empty); tp_value_array_free (reason_array); g_hash_table_unref (updates); g_hash_table_unref (identifiers); return TRUE; }