Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] (PR#2365) gui-gtk: free_sprite doesn't free mask
Home

[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]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#2365) gui-gtk: free_sprite doesn't free mask
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Wed, 20 Nov 2002 17:27:19 -0800
Reply-to: rt@xxxxxxxxxxxxxx

[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



[Prev in Thread] Current Thread [Next in Thread]