static void tile_dealloc(PyGimpTile *self) { gimp_tile_unref(self->tile, FALSE); Py_DECREF(self->drawable); PyObject_DEL(self); }
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); } }