void
wireless_security_unref (WirelessSecurity *sec)
{
	g_return_if_fail (sec != NULL);
	g_return_if_fail (sec->refcount > 0);

	sec->refcount--;
	if (sec->refcount == 0) {
		if (sec->destroy)
			sec->destroy (sec);

		if (sec->builder)
			g_object_unref (sec->builder);
		if (sec->ui_widget)
			g_object_unref (sec->ui_widget);
		g_slice_free1 (sec->obj_size, sec);
	}
}
Ejemplo n.º 2
0
struct PP_Var
ppb_flash_get_proxy_for_url(PP_Instance instance, const char *url)
{
    struct get_proxy_for_url_param_s *p = g_slice_alloc(sizeof(*p));
    p->instance_id =    instance;
    p->url =            url;
    p->m_loop =         ppb_message_loop_get_current();
    p->depth =          ppb_message_loop_get_depth(p->m_loop) + 1;

    ppb_message_loop_post_work_with_result(p->m_loop, PP_MakeCCB(get_proxy_for_url_comt, p), 0,
                                           PP_OK, p->depth, __func__);
    ppb_message_loop_run_nested(p->m_loop);

    struct PP_Var result = p->result;
    g_slice_free1(sizeof(*p), p);

    return result;
}
Ejemplo n.º 3
0
static void
default_free (GstAllocator * allocator, GstMemory * mem)
{
  GstMemorySystem *dmem = (GstMemorySystem *) mem;
  gsize slice_size;

  if (dmem->notify)
    dmem->notify (dmem->user_data);

  slice_size = dmem->slice_size;

#ifdef USE_POISONING
  /* just poison the structs, not all the data */
  memset (mem, 0xff, sizeof (GstMemorySystem));
#endif

  g_slice_free1 (slice_size, mem);
}
Ejemplo n.º 4
0
static void
free_dim_info(GwyCoordsView *view)
{
    CoordsView *priv = view->priv;
    if (!priv->dim_info)
        return;

    guint dimension = priv->coords_class->dimension;
    for (guint i = 0; i < dimension; i++) {
        DimInfo *info = priv->dim_info + i;
        GWY_SIGNAL_HANDLER_DISCONNECT(info->vf, info->vf_notify_id);
        GWY_OBJECT_UNREF(info->vf);
        GWY_FREE(info->units);
    }
    g_slice_free1(dimension*sizeof(DimInfo), priv->dim_info);
    priv->dim_info = NULL;
    g_type_class_unref(priv->coords_class);
}
Ejemplo n.º 5
0
static void
lua_tcp_fin (gpointer arg)
{
	struct lua_tcp_cbdata *cbd = (struct lua_tcp_cbdata *)arg;

	luaL_unref (cbd->L, LUA_REGISTRYINDEX, cbd->cbref);

	if (cbd->fd != -1) {
		event_del (&cbd->ev);
		close (cbd->fd);
	}

	if (cbd->addr) {
		rspamd_inet_address_destroy (cbd->addr);
	}

	g_slice_free1 (sizeof (struct lua_tcp_cbdata), cbd);
}
Ejemplo n.º 6
0
static void	ug_selector_store_clear (GtkListStore* store)
{
	UgSelectorItem*	item;
	GtkTreeModel*	model;
	GtkTreeIter		iter;

	model = GTK_TREE_MODEL (store);
	while (gtk_tree_model_get_iter_first (model, &iter)) {
		gtk_tree_model_get (model, &iter, 0, &item, -1);
		gtk_list_store_remove (store, &iter);

		if (item->dataset)
			ug_dataset_unref (item->dataset);
		else
			g_free (item->uri);
		g_slice_free1 (sizeof (UgSelectorItem), item);
	}
}
Ejemplo n.º 7
0
static
void
update_caret_position_ptac(void *param)
{
    struct update_caret_position_param_s *p = param;
    struct pp_instance_s *pp_i = tables_get_pp_instance(p->instance);
    if (!pp_i) {
        trace_error("%s, bad instance\n", __func__);
        return;
    }

    p->caret.x += pp_i->offset_x;
    p->caret.y += pp_i->offset_y;

    if (pp_i->im_context)
        gw_gtk_im_context_set_cursor_location(pp_i->im_context, &p->caret);
    g_slice_free1(sizeof(*p), p);
}
Ejemplo n.º 8
0
static void
rspamd_archive_dtor (gpointer p)
{
	struct rspamd_archive *arch = p;
	struct rspamd_archive_file *f;
	guint i;

	for (i = 0; i < arch->files->len; i ++) {
		f = g_ptr_array_index (arch->files, i);

		if (f->fname) {
			g_string_free (f->fname, TRUE);
		}
		g_slice_free1 (sizeof (*f), f);
	}

	g_ptr_array_free (arch->files, TRUE);
}
Ejemplo n.º 9
0
static PyObject *
_boxed_new (PyTypeObject *type,
            PyObject     *args,
            PyObject     *kwargs)
{
    static char *kwlist[] = { NULL };

    GIBaseInfo *info;
    gsize size = 0;
    gpointer boxed;
    PyGIBoxed *self = NULL;

    if (!PyArg_ParseTupleAndKeywords (args, kwargs, "", kwlist)) {
        return NULL;
    }

    info = _pygi_object_get_gi_info ( (PyObject *) type, &PyGIBaseInfo_Type);
    if (info == NULL) {
        if (PyErr_ExceptionMatches (PyExc_AttributeError)) {
            PyErr_Format (PyExc_TypeError, "missing introspection information");
        }
        return NULL;
    }

    boxed = _pygi_boxed_alloc (info, &size);
    if (boxed == NULL) {
        PyErr_NoMemory();
        goto out;
    }

    self = (PyGIBoxed *) _pygi_boxed_new (type, boxed, TRUE);
    if (self == NULL) {
        g_slice_free1 (size, boxed);
        goto out;
    }

    self->size = size;
    self->slice_allocated = TRUE;

out:
    g_base_info_unref (info);

    return (PyObject *) self;
}
Ejemplo n.º 10
0
void rm_digest_free(RmDigest *digest) {
    switch(digest->type) {
    case RM_DIGEST_MD5:
    case RM_DIGEST_SHA512:
    case RM_DIGEST_SHA256:
    case RM_DIGEST_SHA1:
        g_checksum_free(digest->glib_checksum);
        digest->glib_checksum = NULL;
        break;
    case RM_DIGEST_PARANOID:
        if(digest->paranoid->shadow_hash) {
            rm_digest_free(digest->paranoid->shadow_hash);
        }
        rm_digest_release_buffers(digest);
        if(digest->paranoid->incoming_twin_candidates) {
            g_async_queue_unref(digest->paranoid->incoming_twin_candidates);
        }
        g_slist_free(digest->paranoid->rejects);
        g_slice_free(RmParanoid, digest->paranoid);
        break;
    case RM_DIGEST_EXT:
    case RM_DIGEST_CUMULATIVE:
    case RM_DIGEST_MURMUR512:
    case RM_DIGEST_XXHASH:
    case RM_DIGEST_CITY512:
    case RM_DIGEST_MURMUR256:
    case RM_DIGEST_CITY256:
    case RM_DIGEST_BASTARD:
    case RM_DIGEST_SPOOKY:
    case RM_DIGEST_SPOOKY32:
    case RM_DIGEST_SPOOKY64:
    case RM_DIGEST_FARMHASH:
    case RM_DIGEST_MURMUR:
    case RM_DIGEST_CITY:
        if(digest->checksum) {
            g_slice_free1(digest->bytes, digest->checksum);
            digest->checksum = NULL;
        }
        break;
    default:
        rm_assert_gentle_not_reached();
    }
    g_slice_free(RmDigest, digest);
}
Ejemplo n.º 11
0
static void
on_track_joints (GObject      *obj,
                 GAsyncResult *res,
                 gpointer      user_data)
{
  guint i;
  BufferInfo *buffer_info;
  guint16 *reduced;
  gint width, height, reduced_width, reduced_height;
  ClutterContent *content;
  GError *error = NULL;

  buffer_info = (BufferInfo *) user_data;
  reduced = (guint16 *) buffer_info->reduced_buffer;
  width = buffer_info->width;
  height = buffer_info->height;
  reduced_width = buffer_info->reduced_width;
  reduced_height = buffer_info->reduced_height;

  list = skeltrack_skeleton_track_joints_finish (skeleton,
                                                 res,
                                                 &error);

  if (error == NULL)
    {
      if (SHOW_SKELETON)
        {
          content = clutter_actor_get_content (depth_tex);
          clutter_content_invalidate (content);
        }
    }
  else
    {
      g_warning ("%s\n", error->message);
      g_error_free (error);
    }

  g_slice_free1 (reduced_width * reduced_height * sizeof (guint16), reduced);

  g_slice_free (BufferInfo, buffer_info);

  skeltrack_joint_list_free (list);
}
Ejemplo n.º 12
0
static int rm_directory_add(RmDirectory *directory, RmFile *file) {
    /* Update the directorie's hash with the file's hash
       Since we cannot be sure in which order the files come in
       we have to add the hash cummulatively.
     */
    int new_dupes = 0;

    g_assert(file);
    g_assert(file->digest);
    g_assert(directory);

    guint8 *file_digest = NULL;
    RmOff digest_bytes = 0;

    if(file->digest->type == RM_DIGEST_PARANOID) {
        file_digest = rm_digest_steal_buffer(file->digest->shadow_hash);
        digest_bytes = file->digest->shadow_hash->bytes;
    } else {
        file_digest = rm_digest_steal_buffer(file->digest);
        digest_bytes = file->digest->bytes;
    }

    /* + and not XOR, since ^ would yield 0 for same hashes always. No matter
     * which hashes. Also this would be confusing. For me and for debuggers.
     */
    rm_digest_update(directory->digest, file_digest, digest_bytes);

    /* The file value is not really used, but we need some non-null value */
    g_hash_table_add(directory->hash_set, file->digest);

    g_slice_free1(digest_bytes, file_digest);

    if(file->hardlinks.is_head && file->hardlinks.files) {
        new_dupes = 1 + g_queue_get_length(file->hardlinks.files);
    } else {
        new_dupes = 1;
    }

    directory->dupe_count += new_dupes;
    directory->prefd_files += file->is_prefd;

    return new_dupes;
}
Ejemplo n.º 13
0
static void c_accept(char *args) {
  struct ui_tab *tab = ui_tab_cur->data;
  if(args[0])
    ui_m(NULL, 0, "This command does not accept any arguments.");
  else if(tab->type != UIT_HUB)
    ui_m(NULL, 0, "This command can only be used on hub tabs.");
#if TLS_SUPPORT
  else if(!tab->hub->kp)
    ui_m(NULL, 0, "Nothing to accept.");
  else {
    char enc[53] = {};
    base32_encode_dat(tab->hub->kp, enc, 32);
    var_set(tab->hub->id, VAR_hubkp, enc, NULL);
    g_slice_free1(32, tab->hub->kp);
    tab->hub->kp = NULL;
    hub_connect(tab->hub);
  }
#else
  else
static void
_gst_context_free (GstContext * context)
{
  GstStructure *structure;

  g_return_if_fail (context != NULL);

  GST_CAT_LOG (GST_CAT_CONTEXT, "finalize context %p: %" GST_PTR_FORMAT,
      context, GST_CONTEXT_STRUCTURE (context));

  structure = GST_CONTEXT_STRUCTURE (context);
  if (structure) {
    gst_structure_set_parent_refcount (structure, NULL);
    gst_structure_free (structure);
  }
  g_free (context->context_type);

  g_slice_free1 (sizeof (GstContext), context);
}
Ejemplo n.º 15
0
static void
goo_canvas_polyline_finalize (GObject *object)
{
  GooCanvasItemSimple *simple = (GooCanvasItemSimple*) object;
  GooCanvasPolyline *polyline = (GooCanvasPolyline*) object;

  /* Free our data if we didn't have a model. (If we had a model it would
     have been reset in dispose() and simple_data will be NULL.) */
  if (simple->simple_data)
    {
      g_slice_free1 (polyline->polyline_data->num_points * 2 * sizeof (gdouble),
		     polyline->polyline_data->coords);
      g_slice_free (GooCanvasPolylineArrowData, polyline->polyline_data->arrow_data);
      g_slice_free (GooCanvasPolylineData, polyline->polyline_data);
    }
  polyline->polyline_data = NULL;

  G_OBJECT_CLASS (goo_canvas_polyline_parent_class)->finalize (object);
}
Ejemplo n.º 16
0
/* Frees the memory pointed to by 'frame' and all the contained
 * config_blocks and the data in their GArrays.
 */
static void config_frame_free(config_frame *frame)
{
	int i = frame->config_blocks->len;

	/* free all the config_blocks this frame contains */
	while (i--) {
		config_block *block;

		block = &g_array_index(frame->config_blocks, config_block, i);
		g_array_free(block->phasors, TRUE);
		g_array_free(block->analogs, TRUE);
	}

	/* free the array of config blocks itself */
	g_array_free(frame->config_blocks, TRUE);

	/* and the config_frame */
	g_slice_free1(sizeof(config_frame), frame);
}
Ejemplo n.º 17
0
void
rspamd_client_destroy (struct rspamd_client_connection *conn)
{
	if (conn != NULL) {
		rspamd_http_connection_unref (conn->http_conn);
		if (conn->req != NULL) {
			rspamd_client_request_free (conn->req);
		}
		close (conn->fd);
		if (conn->key) {
			rspamd_pubkey_unref (conn->key);
		}
		if (conn->keypair) {
			rspamd_keypair_unref (conn->keypair);
		}
		g_string_free (conn->server_name, TRUE);
		g_slice_free1 (sizeof (struct rspamd_client_connection), conn);
	}
}
Ejemplo n.º 18
0
void get(SoupServer *server,
         SoupMessage *msg,
         const char *path)
{

	struct btval key, val;
	key.data = (void*)path+1;
	key.size = strlen(path)-1;
	key.free_data = FALSE;
	key.mp = NULL;
	g_debug ("GET\n Path=%s\n Fetching key %s", path, (char*)key.data);
	const struct btree_stat *stat = btree_stat(btree);
	show_dbstats("",stat);
	if (0 == btree_get(btree,&key,&val)) {
		g_debug ("data checksum is %s", g_compute_checksum_for_data(G_CHECKSUM_MD5, val.data, val.size)); 
		/* we need to make the data 64 bits aligned for gvariant.
		   Best plan is to make all data aligned in the store, but 
		   for now, lets just copy it to somewhere aligned. 
		   TODO: think about fragmentation. it may just be ok, as so far
		   we delete everything we malloc in this function, despite the
		   lifetimes being interleaved.
		*/
		char *buf = g_slice_alloc(val.size + 8);
		char *data = ALIGN_64(buf);
		memcpy (data, val.data, val.size);
		g_debug ("aligned data checksum is %s", g_compute_checksum_for_data(G_CHECKSUM_MD5, data, val.size)); 
		GVariant *gv = g_variant_new_from_data(G_VARIANT_TYPE_VARIANT, data, val.size, TRUE, NULL, NULL);
	
		char *debug = g_variant_print (gv, TRUE);
		g_debug ("converted to %s", debug);
		g_free (debug);

		int length;			
		char* ret = json_gvariant_serialize_data(gv, &length);
		g_variant_unref(gv);
		g_slice_free1 (val.size + 8, buf);
		soup_message_set_status (msg, SOUP_STATUS_OK);
		/*TODO: does soup do anything sensible with it's memory management of responses to reduce the risk of fragmentation?  probably not..*/
		soup_message_set_response (msg, "application/json", SOUP_MEMORY_TAKE, ret, length);
	} else {
		soup_message_set_status (msg, SOUP_STATUS_NOT_FOUND);
	}
}
Ejemplo n.º 19
0
void
eap_method_unref (EAPMethod *method)
{
	g_return_if_fail (method != NULL);
	g_return_if_fail (method->refcount > 0);

	method->refcount--;
	if (method->refcount == 0) {
		if (method->destroy)
			method->destroy (method);

		if (method->builder)
			g_object_unref (method->builder);
		if (method->ui_widget)
			g_object_unref (method->ui_widget);

		g_slice_free1 (method->obj_size, method);
	}
}
Ejemplo n.º 20
0
// best-effort garbage collection. never blocks, never fails. well, sometimes it just doesn't free anything.
void dt_cache_gc(dt_cache_t *cache, const float fill_ratio)
{
  GList *l = cache->lru;
  int cnt = 0;
  while(l)
  {
    cnt++;
    dt_cache_entry_t *entry = (dt_cache_entry_t *)l->data;
    assert(entry->link->data == entry);
    l = g_list_next(l); // we might remove this element, so walk to the next one while we still have the pointer..
    if(cache->cost < cache->cost_quota * fill_ratio) break;

    // if still locked by anyone else give up:
    if(dt_pthread_rwlock_trywrlock(&entry->lock)) continue;

    if(entry->_lock_demoting)
    {
      // oops, we are currently demoting (rw -> r) lock to this entry in some thread. do not touch!
      dt_pthread_rwlock_unlock(&entry->lock);
      continue;
    }

    // delete!
    g_hash_table_remove(cache->hashtable, GINT_TO_POINTER(entry->key));
    cache->lru = g_list_delete_link(cache->lru, entry->link);
    cache->cost -= entry->cost;

    if(cache->cleanup)
    {
      assert(entry->data_size);
      ASAN_UNPOISON_MEMORY_REGION(entry->data, entry->data_size);

      cache->cleanup(cache->cleanup_data, entry);
    }
    else
      dt_free_align(entry->data);

    dt_pthread_rwlock_unlock(&entry->lock);
    dt_pthread_rwlock_destroy(&entry->lock);
    g_slice_free1(sizeof(*entry), entry);
  }
}
Ejemplo n.º 21
0
int
pgm_rxw_shutdown (
	pgm_rxw_t*	r
	)
{
	g_trace ("rxw: shutdown.");

	ASSERT_RXW_BASE_INVARIANT(r);
	ASSERT_RXW_POINTER_INVARIANT(r);

/* pointer array */
	if (r->pdata)
	{
		g_ptr_array_foreach (r->pdata, _list_iterator, r);
		g_ptr_array_free (r->pdata, TRUE);
		r->pdata = NULL;
	}

/* nak/ncf time lists,
 * important: link items are static to each packet struct
 */
	if (r->backoff_queue)
	{
		g_slice_free (GQueue, r->backoff_queue);
		r->backoff_queue = NULL;
	}
	if (r->wait_ncf_queue)
	{
		g_slice_free (GQueue, r->wait_ncf_queue);
		r->wait_ncf_queue = NULL;
	}
	if (r->wait_data_queue)
	{
		g_slice_free (GQueue, r->wait_data_queue);
		r->wait_data_queue = NULL;
	}

/* window */
	g_slice_free1 (sizeof(pgm_rxw_t), r);

	return PGM_RXW_OK;
}
static GstTestPhysMemory* gst_test_phys_mem_allocator_alloc_internal(GstAllocator *allocator, GstMemory *parent, gsize maxsize, GstMemoryFlags flags, gsize align, gsize offset, gsize size)
{
	GstTestPhysMemAllocator *phys_mem_alloc;
	GstTestPhysMemAllocatorClass *klass;
	GstTestPhysMemory *phys_mem;

	phys_mem_alloc = GST_TEST_PHYS_MEM_ALLOCATOR(allocator);
	klass = GST_TEST_PHYS_MEM_ALLOCATOR_CLASS(G_OBJECT_GET_CLASS(allocator));

	//Output a debugging message belonging to the given object in the default category.
	GST_DEBUG_OBJECT(
		allocator,
		"alloc_internal called: maxsize: %u, align: %u, offset: %u, size: %u",
		maxsize,
		align,
		offset,
		size
	);

	phys_mem = gst_test_phys_mem_new_internal(phys_mem_alloc, parent, maxsize, flags, align, offset, size);
	if (phys_mem == NULL)
	{
		GST_WARNING_OBJECT(phys_mem_alloc, "could not create new physmem structure");
		return NULL;
	}

	if (!klass->alloc_phys_mem(phys_mem_alloc, phys_mem, maxsize))
	{
		g_slice_free1(sizeof(GstTestPhysMemory), phys_mem);
		return NULL;
	}

	//GST_MEMORY_FLAG_ZERO_PREFIXED the memory prefix is filled with 0 bytes
	if ((offset > 0) && (flags & GST_MEMORY_FLAG_ZERO_PREFIXED))
	{
		gpointer ptr = klass->map_phys_mem(phys_mem_alloc, phys_mem, maxsize, GST_MAP_WRITE);
		memset(ptr, 0, offset);
		klass->unmap_phys_mem(phys_mem_alloc, phys_mem);
	}

	return phys_mem;
}
bool
p2n_enumerate(NPObject *npobj, NPIdentifier **value, uint32_t *count)
{
    if (npobj->_class == &p2n_proxy_class) {
        struct enumerate_param_s *p = g_slice_alloc(sizeof(*p));
        p->npobj =      npobj;
        p->m_loop =     ppb_message_loop_get_for_browser_thread();
        p->depth =      ppb_message_loop_get_depth(p->m_loop) + 1;

        ppb_message_loop_post_work_with_result(p->m_loop, PP_MakeCCB(p2n_enumerate_prepare_comt, p),
                                               0, PP_OK, 0, __func__);
        ppb_message_loop_run_nested(p->m_loop);
        bool result = p->result;
        *count = p->count;

        *value = npn.memalloc(p->count * sizeof(NPIdentifier));
        char *tmpbuf = malloc(1);
        for (uint32_t k = 0; k < p->count; k ++) {
            uint32_t len = 0;
            const char *s = ppb_var_var_to_utf8(p->values[k], &len);

            // make zero-terminated string
            char *ptr = realloc(tmpbuf, len + 1);
            if (!ptr) {
                result = false;
                goto err;
            }
            tmpbuf = ptr;
            memcpy(tmpbuf, s, len);
            tmpbuf[len] = 0;
            value[k] = npn.getstringidentifier(tmpbuf);
        }

    err:
        free(tmpbuf);
        g_slice_free1(sizeof(*p), p);

        return result;
    } else {
        return npobj->_class->enumerate(npobj, value, count);
    }
}
Ejemplo n.º 24
0
void fbConnSpecFree(
    fbConnSpec_t    *spec)
{
    if (!spec) {
        return;
    }
    if (spec->host) g_free(spec->host);
    if (spec->svc) g_free(spec->svc);
    if (spec->ssl_ca_file) g_free(spec->ssl_ca_file);
    if (spec->ssl_cert_file) g_free(spec->ssl_cert_file);
    if (spec->ssl_key_file) g_free(spec->ssl_key_file);
    if (spec->ssl_key_pass) g_free(spec->ssl_key_pass);
    fbConnSpecFreeAI(spec);
#if HAVE_OPENSSL
    if (spec->vssl_ctx) {
        SSL_CTX_free((SSL_CTX *)spec->vssl_ctx);
    }
#endif
    g_slice_free1(sizeof(fbConnSpec_t), spec);
}
Ejemplo n.º 25
0
gpointer*
g_ptr_array_free (GPtrArray *array,
		  gboolean   free_segment)
{
  gpointer* segment;

  g_return_val_if_fail (array, NULL);

  if (free_segment)
    {
      g_free (array->pdata);
      segment = NULL;
    }
  else
    segment = array->pdata;

  g_slice_free1 (sizeof (GRealPtrArray), array);

  return segment;
}
Ejemplo n.º 26
0
gchar*
g_array_free (GArray   *array,
	      gboolean  free_segment)
{
  gchar* segment;

  g_return_val_if_fail (array, NULL);

  if (free_segment)
    {
      g_free (array->data);
      segment = NULL;
    }
  else
    segment = array->data;

  g_slice_free1 (sizeof (GRealArray), array);

  return segment;
}
Ejemplo n.º 27
0
static void
_gst_event_free (GstEvent * event)
{
  GstStructure *s;

  g_return_if_fail (event != NULL);
  g_return_if_fail (GST_IS_EVENT (event));

  GST_CAT_LOG (GST_CAT_EVENT, "freeing event %p type %s", event,
      GST_EVENT_TYPE_NAME (event));

  s = GST_EVENT_STRUCTURE (event);

  if (s) {
    gst_structure_set_parent_refcount (s, NULL);
    gst_structure_free (s);
  }

  g_slice_free1 (sizeof (GstEventImpl), event);
}
Ejemplo n.º 28
0
static void gst_imx_ipu_blitter_finalize(GObject *object)
{
	GstImxIpuBlitter *ipu_blitter = GST_IMX_IPU_BLITTER(object);

	if (ipu_blitter->previous_input_buffer != NULL)
		gst_buffer_unref(ipu_blitter->previous_input_buffer);
	if (ipu_blitter->actual_input_buffer != NULL)
		gst_buffer_unref(ipu_blitter->actual_input_buffer);
	if (ipu_blitter->internal_bufferpool != NULL)
		gst_object_unref(ipu_blitter->internal_bufferpool);

	if (ipu_blitter->priv != NULL)
	{
		if (ipu_blitter->priv->ipu_fd >= 0)
			close(ipu_blitter->priv->ipu_fd);
		g_slice_free1(sizeof(GstImxIpuBlitterPrivate), ipu_blitter->priv);
	}

	G_OBJECT_CLASS(gst_imx_ipu_blitter_parent_class)->finalize(object);
}
Ejemplo n.º 29
0
static gboolean
paint_texture (guchar *buffer, guint width, guint height)
{
  GError *error = NULL;
  if (! clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (depth_tex),
                                           buffer,
                                           FALSE,
                                           width, height,
                                           0,
                                           3,
                                           CLUTTER_TEXTURE_NONE,
                                           &error))
    {
      g_debug ("Error setting texture area: %s", error->message);
      g_error_free (error);
      return FALSE;
    }
  g_slice_free1 (width * height * sizeof (guchar) * 3, buffer);
  return TRUE;
}
Ejemplo n.º 30
0
static void
_boxed_dealloc (PyGIBoxed *self)
{
    GType g_type;

    PyObject_GC_UnTrack ( (PyObject *) self);

    PyObject_ClearWeakRefs ( (PyObject *) self);

    if ( ( (PyGBoxed *) self)->free_on_dealloc) {
        if (self->slice_allocated) {
            g_slice_free1 (self->size, ( (PyGBoxed *) self)->boxed);
        } else {
            g_type = pyg_type_from_object ( (PyObject *) self);
            g_boxed_free (g_type, ( (PyGBoxed *) self)->boxed);
        }
    }

    Py_TYPE( (PyGObject *) self)->tp_free ( (PyObject *) self);
}