Re: [Freeciv-Dev] xaw client Find City and Airlift/Goto dialogs report e
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Jeff Mallatt wrote:
> In the xaw client, the Find City and Airlift/Goto dialogs report an empty
> malloc
> if opened when there are no cities.
>
> This patch fixes the problem by simply disabling these menu items if the
> player
> has no cities.
But those dialogs can still be useful if the player has no cities,
but knows of some enemy cities.
Maybe use a function in the client to return the number of cities
the player know. May be slow though, in terms of doing lots
of menu updates...
Or just check explicitly for those dialogs if we are about to
fc_malloc(0), and do some other sensible thing if so.
Or even, in fc_malloc(), remove or downgrade that warning.
(Although I kind of like the warning, since its convenient to
consider fc_malloc to guarantee always returning non-NULL (or
die() in the attempt), but this is one case where it _will_
return NULL.)
Regards,
-- David
|
|