[Freeciv-Dev] GTK+ client memory leaks
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Howdy,
I found a whole heap of memory leaks in the GTK+ client produced by
spurious use of the intl_slist() function and "forgetting" to free the
memory afterwards. This affects the city dialog and a bunch of other places.
Such mallocing is unwarranted in the first place so I recomend we replace
that most troublesome function with this one:
void intl_slist(int n, const char **s, bool *done)
{
int i;
if (!*done) {
for(i=0; i<n; i++) {
s[i] = _(s[i]);
}
*done = TRUE;
}
}
You would use it like this:
static gchar *title[4] =
{ N_("Type"), N_("Info"), N_("Cost"), N_("Turns") };
static bool title_done;
intl_slist(ARRAY_SIZE(title), title, &title_done);
---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa
- [Freeciv-Dev] GTK+ client memory leaks,
Vasco Alexandre Da Silva Costa <=
|
|