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); } }
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); }
/** * 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); } }
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); } }
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); } }
/** * 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); }
/** * 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); }
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); } }
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); }
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; } }
/** * 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); }
/** * 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); } }
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); }
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); }
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); } }
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); } }
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); } }
/** * 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); }
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); }
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); } }
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); }
/** * 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); }
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); }
void seaf_repo_unref (SeafRepo *repo) { if (!repo) return; if (g_atomic_int_dec_and_test (&repo->ref_cnt)) seaf_repo_free (repo); }
/** * 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); }
/** * 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); }
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); } }