[Freeciv-tickets] [freeciv] #44312: Check usability of all objects that can changeafter signals

Back to archive index
OSDN Ticket System norep****@osdn*****
Sun Apr 10 08:16:24 JST 2022


#44312: Check usability of all objects that can changeafter signals

  Open Date: 2022-04-10 02:16
Last Update: 2022-04-10 02:16

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/44312
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44312

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-04-10 02:16 Updated by: ihnatus
 * New Ticket "Check usability of all objects that can changeafter signals" created


---------------------------------------------------------------------
Ticket Status:

      Reporter: ihnatus
         Owner: (None)
          Type: Bugs
        Status: Open
      Priority: 5 - Medium
     MileStone: 3.0.2
     Component: Server
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

That problem is related to the realization of #44286 but actually parts of it  (except player complete removal that is now impossible by scripts) already present in 3.0 branch. We must check after any direct or indirect call of any signal that any pointer on a unit, a city a player we have obtained before the callback is valid when we use it after, and if so, that this object is still in the scope it is supposed to be (player is alive, city belongs to the same owner etc.) Maybe we have to rewrite some iterators in some places.
Note: generic existence test for a city or a unit is comparing pointer at their saved index to their saved pointer. For players, this test is not 100% reliable since player indices may be reused but at least it guarantees that we get some valid player pointer, and the probability of creating new player object at the same memory address is low on most OSs.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/44312
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44312



More information about the Freeciv-tickets mailing list
Back to archive index