Exemplo n.º 1
0
void grava_renderer_unref (gpointer instance) {
	GravaRenderer* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GRAVA_RENDERER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}
Exemplo n.º 2
0
static void gtkhash_hash_file_hash_thread(void *func, struct hash_file_s *data)
{
	gtkhash_hash_lib_update(&data->funcs[GPOINTER_TO_UINT(func) - 1],
		data->buffer, data->just_read);

	if (g_atomic_int_dec_and_test(&data->pool_threads_n))
		gtkhash_hash_file_add_source(data);
}
Exemplo n.º 3
0
/**
 * gst_ts_cache_unref:
 * @cache: a #GstTSCache
 *
 * Unref @cache and free the resources when the refcount reaches 0.
 *
 */
void
gst_ts_cache_unref (GstTSCache * cache)
{
  g_return_if_fail (cache != NULL);

  if (g_atomic_int_dec_and_test (&cache->refcount))
    gst_ts_cache_free (cache);
}
void request_handler_unref (gpointer instance) {
	RequestHandler* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		REQUEST_HANDLER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}
Exemplo n.º 5
0
void graph_media_modelos_sentimiento_unref (gpointer instance) {
	GraphMediaModelosSentimiento* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		GRAPH_MEDIA_MODELOS_SENTIMIENTO_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}
Exemplo n.º 6
0
void hello_world_unref (gpointer instance) {
	HelloWorld* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		HELLO_WORLD_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}
Exemplo n.º 7
0
/**
 * st_icon_colors_unref:
 * @colors: a #StIconColors
 *
 * Atomically decrements the reference count of @colors by one.
 * If the reference count drops to 0, all memory allocated by the
 * #StIconColors is released.
 */
void
st_icon_colors_unref (StIconColors *colors)
{
  g_return_if_fail (colors != NULL);
  g_return_if_fail (colors->ref_count > 0);

  if (g_atomic_int_dec_and_test ((volatile int *)&colors->ref_count))
    g_slice_free (StIconColors, colors);
}
Exemplo n.º 8
0
/**
 * iris_rrobin_unref:
 * @rrobin: An #IrisRRobin
 *
 * Atomically decreates the reference count of @rrobin. If the reference
 * count reaches zero, teh object is destroyed and all its allocated
 * resources are freed.
 */
void
iris_rrobin_unref (IrisRRobin *rrobin)
{
	g_return_if_fail (rrobin != NULL);
	g_return_if_fail (rrobin->ref_count > 0);

	if (g_atomic_int_dec_and_test (&rrobin->ref_count))
		iris_rrobin_free (rrobin);
}
Exemplo n.º 9
0
static void
write_data_unref (WriteData *write_data)
{
  if (g_atomic_int_dec_and_test (&write_data->ref_count)) {
    g_cond_clear (&write_data->cond);
    g_mutex_clear (&write_data->mutex);
    g_slice_free (WriteData, write_data);
  }
}
Exemplo n.º 10
0
static void auth_file_data_release(AuthFileData *data) {
	if (!data) return;
	assert(g_atomic_int_get(&data->refcount) > 0);
	if (!g_atomic_int_dec_and_test(&data->refcount)) return;

	g_hash_table_destroy(data->users);
	g_free(data->contents);
	g_slice_free(AuthFileData, data);
}
Exemplo n.º 11
0
void hinawa_context_remove_src(GSource *src)
{
	g_source_destroy(src);
	if (g_atomic_int_dec_and_test(&counter)) {
		running = FALSE;
		g_thread_join(thread);
		thread = NULL;
	}
}
Exemplo n.º 12
0
/**
 * st_shadow_unref:
 * @shadow: a #StShadow
 *
 * Atomically decrements the reference count of @shadow by one.
 * If the reference count drops to 0, all memory allocated by the
 * #StShadow is released.
 */
void
st_shadow_unref (StShadow *shadow)
{
  g_return_if_fail (shadow != NULL);
  g_return_if_fail (shadow->ref_count > 0);

  if (g_atomic_int_dec_and_test (&shadow->ref_count))
    g_slice_free (StShadow, shadow);
}
Exemplo n.º 13
0
/**
 * g_resource_unref:
 * @resource: A #GResource
 *
 * Atomically decrements the reference count of @resource by one. If the
 * reference count drops to 0, all memory allocated by the array is
 * released. This function is MT-safe and may be called from any
 * thread.
 *
 * Since: 2.32
 **/
void
g_resource_unref (GResource *resource)
{
  if (g_atomic_int_dec_and_test (&resource->ref_count))
    {
      gvdb_table_unref (resource->table);
      g_free (resource);
    }
}
Exemplo n.º 14
0
void
ide_pattern_spec_unref (IdePatternSpec *self)
{
  g_return_if_fail (self);
  g_return_if_fail (self->ref_count > 0);

  if (g_atomic_int_dec_and_test (&self->ref_count))
    ide_pattern_spec_free (self);
}
Exemplo n.º 15
0
static void
g_vfs_ftp_dir_cache_entry_unref (GVfsFtpDirCacheEntry *entry)
{
  if (!g_atomic_int_dec_and_test (&entry->refcount))
    return;

  g_hash_table_destroy (entry->files);
  g_slice_free (GVfsFtpDirCacheEntry, entry);
}
Exemplo n.º 16
0
static void proxy_context_release(proxy_context *ctx) {
	if (!ctx) return;
	LI_FORCE_ASSERT(g_atomic_int_get(&ctx->refcount) > 0);
	if (g_atomic_int_dec_and_test(&ctx->refcount)) {
		li_backend_pool_free(ctx->pool);
		g_string_free(ctx->socket_str, TRUE);
		g_slice_free(proxy_context, ctx);
	}
}
Exemplo n.º 17
0
static void proxy_context_release(proxy_context *ctx) {
	if (!ctx) return;
	assert(g_atomic_int_get(&ctx->refcount) > 0);
	if (g_atomic_int_dec_and_test(&ctx->refcount)) {
		li_sockaddr_clear(&ctx->socket);
		g_string_free(ctx->socket_str, TRUE);
		g_slice_free(proxy_context, ctx);
	}
}
static void
release_data (GstVdpVideoMemory * vmem)
{
  g_return_if_fail (vmem->refcount > 0);

  if (g_atomic_int_dec_and_test (&vmem->refcount)) {
    g_free (vmem->cache);
  }
}
Exemplo n.º 19
0
void
tracker_priority_queue_unref (TrackerPriorityQueue *queue)
{
	if (g_atomic_int_dec_and_test (&queue->ref_count)) {
		g_queue_clear (&queue->queue);
		g_array_free (queue->segments, TRUE);
		g_slice_free (TrackerPriorityQueue, queue);
	}
}
Exemplo n.º 20
0
/**
 * g_array_unref:
 * @array: A #GArray.
 *
 * Atomically decrements the reference count of @array by one. If the
 * reference count drops to 0, all memory allocated by the array is
 * released. This function is MT-safe and may be called from any
 * thread.
 *
 * Since: 2.22
 **/
void
g_array_unref (GArray *array)
{
  GRealArray *rarray = (GRealArray*) array;
  g_return_if_fail (array);
  g_return_if_fail (g_atomic_int_get (&rarray->ref_count) > 0);
  if (g_atomic_int_dec_and_test (&rarray->ref_count))
    g_array_free (array, TRUE);
}
/**
 * gst_vaapi_video_meta_unref:
 * @meta: a #GstVaapiVideoMeta
 *
 * Atomically decreases the reference count of the @meta by one. If
 * the reference count reaches zero, the object will be free'd.
 */
void
gst_vaapi_video_meta_unref (GstVaapiVideoMeta * meta)
{
  g_return_if_fail (meta != NULL);
  g_return_if_fail (meta->ref_count > 0);

  if (g_atomic_int_dec_and_test (&meta->ref_count))
    _gst_vaapi_video_meta_free (meta);
}
Exemplo n.º 22
0
void
meta_barrier_event_unref (MetaBarrierEvent *event)
{
  g_return_if_fail (event != NULL);
  g_return_if_fail (event->ref_count > 0);

  if (g_atomic_int_dec_and_test ((volatile int *)&event->ref_count))
    g_slice_free (MetaBarrierEvent, event);
}
Exemplo n.º 23
0
void wmxsdk_unref(struct wmxsdk *wmxsdk)
{
	if (g_atomic_int_dec_and_test(&wmxsdk->refcount)) {
		g_mutex_clear(&wmxsdk->status_mutex);
		g_mutex_clear(&wmxsdk->connect_mutex);
		memset(wmxsdk, 0, sizeof(*wmxsdk));
		free(wmxsdk);
	}
}
Exemplo n.º 24
0
void
egg_counter_arena_unref (EggCounterArena *arena)
{
  g_return_if_fail (arena);
  g_return_if_fail (arena->ref_count);

  if (g_atomic_int_dec_and_test (&arena->ref_count))
    _egg_counter_arena_destroy (arena);
}
Exemplo n.º 25
0
/**
 * gst_date_time_unref:
 * @datetime: (transfer full): a #GstDateTime
 *
 * Atomically decrements the reference count of @datetime by one.  When the
 * reference count reaches zero, the structure is freed.
 *
 * Since: 0.10.31
 */
void
gst_date_time_unref (GstDateTime * datetime)
{
  g_return_if_fail (datetime != NULL);
  g_return_if_fail (datetime->ref_count > 0);

  if (g_atomic_int_dec_and_test (&datetime->ref_count))
    gst_date_time_free (datetime);
}
Exemplo n.º 26
0
void
tmpl_expr_unref (TmplExpr *self)
{
  g_return_if_fail (self != NULL);
  g_return_if_fail (self->any.ref_count > 0);

  if (g_atomic_int_dec_and_test (&self->any.ref_count))
    tmpl_expr_destroy (self);
}
Exemplo n.º 27
0
void
seaf_repo_unref (SeafRepo *repo)
{
    if (!repo)
        return;

    if (g_atomic_int_dec_and_test (&repo->ref_cnt))
        seaf_repo_free (repo);
}
Exemplo n.º 28
0
/**
 * g_mapped_file_unref:
 * @file: a #GMappedFile
 *
 * Decrements the reference count of @file by one.  If the reference count
 * drops to 0, unmaps the buffer of @file and frees it.
 *
 * It is safe to call this function from any thread.
 *
 * Since 2.22
 **/
void
g_mapped_file_unref (GMappedFile *file)
{
  g_return_if_fail (file != NULL);
  g_return_if_fail (file->ref_count > 0);

  if (g_atomic_int_dec_and_test (&file->ref_count))
    g_mapped_file_destroy (file);
}
Exemplo n.º 29
0
Arquivo: garray.c Projeto: Babelz/SaNi
/**
 * g_array_unref:
 * @array: A #GArray
 *
 * Atomically decrements the reference count of @array by one. If the
 * reference count drops to 0, all memory allocated by the array is
 * released. This function is MT-safe and may be called from any
 * thread.
 *
 * Since: 2.22
 */
void
g_array_unref (GArray *array)
{
  GRealArray *rarray = (GRealArray*) array;
  g_return_if_fail (array);

  if (g_atomic_int_dec_and_test (&rarray->ref_count))
    array_free (rarray, FREE_SEGMENT);
}
Exemplo n.º 30
0
void fm_list_unref(FmList* list)
{
	if(g_atomic_int_dec_and_test(&list->n_ref))
	{
		g_queue_foreach((GQueue*)list, (GFunc)list->funcs->item_unref, NULL);
		g_queue_clear((GQueue*)list);
		g_slice_free(FmList, list);
	}
}