コード例 #1
0
ファイル: pygimp-tile.c プロジェクト: jdburton/gimp-osx
static void
tile_dealloc(PyGimpTile *self)
{
    gimp_tile_unref(self->tile, FALSE);

    Py_DECREF(self->drawable);
    PyObject_DEL(self);
}
コード例 #2
0
ファイル: gimptile.c プロジェクト: jiapei100/gimp
static void
gimp_tile_cache_flush (GimpTile *tile)
{
  GList *list;

  if (! tile_hash_table)
    return;

  /* Find where the tile is in the cache.
   */
  list = g_hash_table_lookup (tile_hash_table, tile);

  if (list)
    {
      /* If the tile is in the cache, then remove it from the
       *  tile list.
       */
      if (list == tile_list_tail)
        tile_list_tail = tile_list_tail->prev;

      tile_list_head = g_list_remove_link (tile_list_head, list);

      if (! tile_list_head)
        tile_list_tail = NULL;

      /* Remove the tile from the tile hash table.
       */
      g_hash_table_remove (tile_hash_table, tile);
      g_list_free (list);

      /* Note the decrease in the number of bytes the cache
       *  is referencing.
       */
      cur_cache_size -= max_tile_size;

      /* Unreference the tile.
       */
      gimp_tile_unref (tile, FALSE);
    }
}