Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] (PR#4521) SDL diplomat/city pointers may be garbage
Home

[Freeciv-Dev] (PR#4521) SDL diplomat/city pointers may be garbage

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#4521) SDL diplomat/city pointers may be garbage
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 9 Jul 2003 11:06:50 -0700
Reply-to: rt@xxxxxxxxxxxxxx

In most GUIs when a diplomat dialog is popped up the GUI tracks the ID
of the diplomat and that of the target city or unit.

In gui-sdl, however, pointers to the unit/city are tracked instead. 
This is unsafe since while the diplomat dialog is up action continues
(at least it should), and the diplomat, target unit, or target city may
die.  This would then mean the pointer points to garbage, giving
unpredictible and bad results.

Note how in other GUIs there are careful checks to make sure the
diplomat and target still exist (find_unit_by_id/find_city_by_id) before
the request is sent to the server.

jason



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#4521) SDL diplomat/city pointers may be garbage, Jason Short <=