[Freeciv-Dev] (PR#2365) gui-gtk: free_sprite doesn't free mask
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
[jdorje - Tue Nov 19 22:57:19 2002]:
> The free_sprite() function in the GTK client doesn't free the sprite's
> mask. This means a certain amount of memory leak will be unavoidable,
> especially when switching tilesets.
As discussed on IRC: the problem here is that gdk_imlib_free_pixmap
frees the mask associated with the pixmap - IF the pixmap was allocated
using imlib. Some sprites are allocated using imlib (when they are
first loaded), but most are allocated directly by gdk (in crop_sprite).
A couple of different solutions were discussed: making all sprites
either one or the other, storing whether the mask needs to be
unreferenced in the sprite struct, or scrapping imlib entirely and using
GdkPixbuf.
jason
|
|