static void
e_data_book_factory_finalize (GObject *object)
{
	EDataBookFactory *factory = E_DATA_BOOK_FACTORY (object);
	EDataBookFactoryPrivate *priv = factory->priv;

	g_mutex_free (priv->map_mutex);
	g_hash_table_destroy (priv->active_server_map);
	g_hash_table_destroy (priv->backends);
	g_free (priv->iid);
	g_free (priv);

	if (G_OBJECT_CLASS (e_data_book_factory_parent_class)->finalize)
		G_OBJECT_CLASS (e_data_book_factory_parent_class)->finalize (object);
}
Example #2
0
static void balancer_free(liServer *srv, balancer *b) {
	guint i;
	if (!b) return;
	g_mutex_free(b->lock);

	li_event_clear(&b->backlog_timer);
	li_event_clear(&b->async);

	for (i = 0; i < b->backends->len; i++) {
		backend *be = &g_array_index(b->backends, backend, i);
		li_action_release(srv, be->act);
	}
	g_array_free(b->backends, TRUE);
	g_slice_free(balancer, b);
}
static void
gst_directsound_sink_finalise (GObject * object)
{
  GstDirectSoundSink *dsoundsink = GST_DIRECTSOUND_SINK (object);

  g_mutex_free (dsoundsink->dsound_lock);

  if (dsoundsink->tracks) {
    g_list_foreach (dsoundsink->tracks, (GFunc) g_object_unref, NULL);
    g_list_free (dsoundsink->tracks);
    dsoundsink->tracks = NULL;
  }

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
Example #4
0
static void
shell_recorder_src_finalize (GObject *object)
{
    ShellRecorderSrc *src = SHELL_RECORDER_SRC (object);

    if (src->memory_used_update_idle)
        g_source_remove (src->memory_used_update_idle);

    shell_recorder_src_set_caps (src, NULL);
    g_async_queue_unref (src->queue);

    g_mutex_free (src->mutex);

    G_OBJECT_CLASS (parent_class)->finalize (object);
}
Example #5
0
static void balancer_free(liServer *srv, balancer *b) {
	guint i;
	if (!b) return;
	g_mutex_free(b->lock);

	ev_timer_stop(b->wrk->loop, &b->backlog_timer);
	li_ev_safe_ref_and_stop(ev_async_stop, b->wrk->loop, &b->async);

	for (i = 0; i < b->backends->len; i++) {
		backend *be = &g_array_index(b->backends, backend, i);
		li_action_release(srv, be->act);
	}
	g_array_free(b->backends, TRUE);
	g_slice_free(balancer, b);
}
Example #6
0
static void
finalize_impl(
    GObject * obj_self)
{
    XferSourceRecovery *self = XFER_SOURCE_RECOVERY(obj_self);

    if (self->conn)
	g_object_unref(self->conn);
    if (self->device)
	g_object_unref(self->device);

    g_cond_free(self->start_part_cond);
    g_cond_free(self->abort_cond);
    g_mutex_free(self->start_part_mutex);
}
static void
camel_store_summary_finalise (CamelObject *obj)
{
	struct _CamelStoreSummaryPrivate *p;
	CamelStoreSummary *s = (CamelStoreSummary *)obj;

	p = _PRIVATE(obj);

	camel_store_summary_clear(s);
	g_ptr_array_free(s->folders, TRUE);
	g_hash_table_destroy(s->folders_path);

	g_free(s->summary_path);

	if (s->store_info_chunks)
		e_memchunk_destroy(s->store_info_chunks);

	g_mutex_free(p->summary_lock);
	g_mutex_free(p->io_lock);
	g_mutex_free(p->alloc_lock);
	g_mutex_free(p->ref_lock);

	g_free(p);
}
Example #8
0
static void
cleanup_mpeg2enc (GstElement * mpeg2enc)
{
    GST_DEBUG ("cleanup_mpeg2enc");
    gst_element_set_state (mpeg2enc, GST_STATE_NULL);

    gst_pad_set_active (mysrcpad, FALSE);
    gst_pad_set_active (mysinkpad, FALSE);
    gst_check_teardown_src_pad (mpeg2enc);
    gst_check_teardown_sink_pad (mpeg2enc);
    gst_check_teardown_element (mpeg2enc);

    g_mutex_free (mpeg2enc_mutex);
    g_cond_free (mpeg2enc_cond);
}
Example #9
0
void
cdda_scanner_stop(void) {

	cdda_scanner_working = 0;
	AQUALUNG_THREAD_JOIN(cdda_scanner_id)

	cdda_timeout_callback(NULL); /* cleanup any leftover messages */
	cdda_timeout_stop();

#ifdef _WIN32
	g_mutex_free(cdda_mutex);
#endif /* _WIN32 */

	rb_free(cdda_notify_rb);
}
static void
gst_pvrvideosink_finalize (GObject * object)
{
  GstPVRVideoSink *pvrvideosink;

  pvrvideosink = GST_PVRVIDEOSINK (object);

  gst_pvrvideosink_reset (pvrvideosink);

  if (pvrvideosink->flow_lock) {
    g_mutex_free (pvrvideosink->flow_lock);
    pvrvideosink->flow_lock = NULL;
  }

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
Example #11
0
void stop(void) {
	if (!sc_going && !ge_going)
		return;
	g_mutex_lock(m_scrobbler);

	if (sc_going)
		sc_cleaner();
	sc_going = 0;
	ge_going = 0;
	g_mutex_unlock(m_scrobbler);

	g_mutex_free(m_scrobbler);

	hook_dissociate("playback begin", mlp_hook_playback_begin);
	hook_dissociate("playback stop", mlp_hook_playback_end);
}
Example #12
0
void
g_omx_core_free (GOmxCore *core)
{
    g_omx_core_deinit (core);     /* just in case we didn't have a READY->NULL.. mainly for gst-inspect */

    g_sem_free (core->port_sem);
    g_sem_free (core->flush_sem);
    g_sem_free (core->done_sem);

    g_mutex_free (core->omx_state_mutex);
    g_cond_free (core->omx_state_condition);

    g_ptr_array_free (core->ports, TRUE);

    g_free (core);
}
Example #13
0
void
g_omx_core_free (GOmxCore *core)
{
    core_deinit (core);

    g_sem_free (core->port_sem);
    g_sem_free (core->flush_sem);
    g_sem_free (core->done_sem);

    g_mutex_free (core->omx_state_mutex);
    g_cond_free (core->omx_state_condition);

    g_ptr_array_free (core->ports, TRUE);

    g_free (core);
}
Example #14
0
static void mbb_task_free(struct mbb_task *task)
{
	mbb_plock_writer_lock();

	if (ht != NULL)
		g_hash_table_remove(ht, GINT_TO_POINTER(task->id));

	mbb_plock_writer_unlock();

	mbb_module_unuse(task->mod);
	mbb_user_unref(task->user);

	g_mutex_free(task->mutex);
	g_cond_free(task->cond);
	g_free(task);
}
/**
 * camel_object_bag_destroy:
 * @bag: a #CamelObjectBag
 *
 * Frees @bag.  As a precaution, the function will emit a warning to standard
 * error and return without freeing @bag if @bag still has reserved keys.
 **/
void
camel_object_bag_destroy (CamelObjectBag *bag)
{
	g_return_if_fail (bag != NULL);
	g_return_if_fail (bag->reserved == NULL);

	/* Drop remaining weak references. */
	g_hash_table_foreach (
		bag->object_table, (GHFunc)
		object_bag_weak_unref, bag);

	g_hash_table_destroy (bag->key_table);
	g_hash_table_destroy (bag->object_table);
	g_mutex_free (bag->mutex);
	g_slice_free (CamelObjectBag, bag);
}
Example #16
0
static void
terminate_intercom (APP_STATE_T * state)
{
  /* Release intercom */
  if (state->queue) {
    g_async_queue_unref (state->queue);
  }

  if (state->queue_lock) {
    g_mutex_free (state->queue_lock);
  }

  if (state->cond) {
    g_cond_free (state->cond);
  }
}
static void gvir_storage_pool_finalize(GObject *object)
{
    GVirStoragePool *pool = GVIR_STORAGE_POOL(object);
    GVirStoragePoolPrivate *priv = pool->priv;

    if (priv->volumes) {
        g_hash_table_unref(priv->volumes);
        priv->volumes = NULL;
    }

    virStoragePoolFree(priv->handle);

    g_mutex_free(priv->lock);

    G_OBJECT_CLASS(gvir_storage_pool_parent_class)->finalize(object);
}
Example #18
0
static void
gst_dvbsrc_finalize (GObject * _object)
{
    GstDvbSrc *object;

    GST_DEBUG_OBJECT (_object, "gst_dvbsrc_finalize");

    g_return_if_fail (GST_IS_DVBSRC (_object));
    object = GST_DVBSRC (_object);

    /* freeing the mutex segfaults somehow */
    g_mutex_free (object->tune_mutex);

    if (G_OBJECT_CLASS (parent_class)->finalize)
        G_OBJECT_CLASS (parent_class)->finalize (_object);
}
Example #19
0
File: output.c Project: worr/wsh
void wshc_cleanup_output(wshc_output_info_t** out) {
	g_assert(*out);

	g_hash_table_destroy((*out)->output);
	g_hash_table_destroy((*out)->failed_hosts);

#if GLIB_CHECK_VERSION(2, 32, 0)
	g_mutex_clear((*out)->mut);
	g_slice_free(GMutex, (*out)->mut);
#else
	g_mutex_free((*out)->mut);
#endif

	g_slice_free(wshc_output_info_t, *out);
	*out = NULL;
}
static void entangle_pixbuf_loader_finalize(GObject *object)
{
    EntanglePixbufLoader *loader = ENTANGLE_PIXBUF_LOADER(object);
    EntanglePixbufLoaderPrivate *priv = loader->priv;

    ENTANGLE_DEBUG("Finalize pixbuf loader %p", object);
    g_thread_pool_free(priv->workers, TRUE, TRUE);

    if (priv->colourTransform)
        g_object_unref(priv->colourTransform);

    g_hash_table_unref(priv->pixbufs);
    g_mutex_free(priv->lock);

    G_OBJECT_CLASS(entangle_pixbuf_loader_parent_class)->finalize(object);
}
Example #21
0
static void
fs_rtp_sub_stream_finalize (GObject *object)
{
  FsRtpSubStream *self = FS_RTP_SUB_STREAM (object);

  if (self->codec)
    fs_codec_destroy (self->codec);

  if (self->priv->caps)
    gst_caps_unref (self->priv->caps);

  if (self->priv->mutex)
    g_mutex_free (self->priv->mutex);

  G_OBJECT_CLASS (fs_rtp_sub_stream_parent_class)->finalize (object);
}
Example #22
0
/**
 * g_async_queue_unref:
 * @queue: a #GAsyncQueue.
 * 
 * Decreases the reference count of the asynchronous @queue by 1. If
 * the reference count went to 0, the @queue will be destroyed and the
 * memory allocated will be freed. So you are not allowed to use the
 * @queue afterwards, as it might have disappeared. You do not need to
 * hold the lock to call this function.
 **/
void 
g_async_queue_unref (GAsyncQueue *queue)
{
  g_return_if_fail (queue);
  g_return_if_fail (g_atomic_int_get (&queue->ref_count) > 0);
  
  if (g_atomic_int_dec_and_test (&queue->ref_count))
    {
      g_return_if_fail (queue->waiting_threads == 0);
      g_mutex_free (queue->mutex);
      if (queue->cond)
	g_cond_free (queue->cond);
      g_queue_free (queue->queue);
      g_free (queue);
    }
}
static void
mbox_free( XfceMailwatchMailbox *mailbox )
{
    XfceMailwatchMboxMailbox    *mbox = XFCE_MAILWATCH_MBOX_MAILBOX( mailbox );

    mbox_activate( mailbox, FALSE );
    while( g_atomic_pointer_get( &mbox->thread ) )
        g_thread_yield();
    
    g_mutex_free( mbox->settings_mutex );

    if ( mbox->fn ) {
        g_free( mbox->fn );
    }
    g_free( mbox );
}
Example #24
0
void kp_server_destroy(KPServer *self)
{
  h_in_t *core = Hgetinstance();
  whiteboard_log_debug_fb();

  g_mutex_lock( self->send_lock);
  
  nota_stub_context_pointer_free(self->cp);
  Hclose(core, self->fd);
  g_object_unref( G_OBJECT(self->sib));
  g_mutex_unlock( self->send_lock);
  g_mutex_free(self->send_lock);
  g_free(self);
  whiteboard_log_debug_fe();

}
/**
 * Free resources held by GMDNS
 */
void
daap_mdns_destroy ()
{
	GSList *n;
	g_return_if_fail (g_mdns);

	g_mdns_stop_browsing (g_mdns);

	g_mutex_lock (g_mdns->mutex);
	for (n = g_mdns->service_list; n; n = g_slist_next (n)) {
		g_mdns_server_destroy (n->data);
	}
	g_mutex_unlock (g_mdns->mutex);
	g_mutex_free (g_mdns->mutex);

	g_free (g_mdns);
}
Example #26
0
static void
gst_kate_tiger_dispose (GObject * object)
{
  GstKateTiger *tiger = GST_KATE_TIGER (object);

  GST_LOG_OBJECT (tiger, "disposing");

  if (tiger->default_font_desc) {
    g_free (tiger->default_font_desc);
    tiger->default_font_desc = NULL;
  }

  g_mutex_free (tiger->mutex);
  tiger->mutex = NULL;

  GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
}
Example #27
0
static void
cinnamon_recorder_src_finalize (GObject *object)
{
  CinnamonRecorderSrc *src = CINNAMON_RECORDER_SRC (object);

  if (src->memory_used_update_idle) {
    g_source_remove (src->memory_used_update_idle);
    src->memory_used_update_idle = 0;
  }

  cinnamon_recorder_src_set_caps (src, NULL);
  g_async_queue_unref (src->queue);

  g_mutex_free (src->mutex);

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gst_sunaudiosink_finalize (GObject * object)
{
  GstSunAudioSink *sunaudiosink = GST_SUNAUDIO_SINK (object);

  g_mutex_free (sunaudiosink->write_mutex);
  g_cond_free (sunaudiosink->sleep_cond);

  g_free (sunaudiosink->device);

  if (sunaudiosink->fd != -1) {
    close (sunaudiosink->fd);
    sunaudiosink->fd = -1;
  }

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
Example #29
0
static void
gst_shape_wipe_finalize (GObject * object)
{
  GstShapeWipe *self = GST_SHAPE_WIPE (object);

  gst_shape_wipe_reset (self);

  if (self->mask_cond)
    g_cond_free (self->mask_cond);
  self->mask_cond = NULL;

  if (self->mask_mutex)
    g_mutex_free (self->mask_mutex);
  self->mask_mutex = NULL;

  G_OBJECT_CLASS (parent_class)->finalize (object);
}
Example #30
0
static void lcm_memq_destroy(lcm_memq_t *self)
{
    dbg(DBG_LCM, "destroying LCM memq provider context\n");
    if (self->notify_pipe[0] >= 0)
        lcm_internal_pipe_close(self->notify_pipe[0]);
    if (self->notify_pipe[1] >= 0)
        lcm_internal_pipe_close(self->notify_pipe[1]);

    while (!g_queue_is_empty(self->queue)) {
        memq_msg_t *msg = (memq_msg_t *) g_queue_pop_head(self->queue);
        memq_msg_destroy(msg);
    }
    g_queue_free(self->queue);
    g_mutex_free(self->mutex);
    memset(self, 0, sizeof(lcm_memq_t));
    free(self);
}