Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2005:
[Freeciv-Dev] (PR#13812) crash when closing client while detached
Home

[Freeciv-Dev] (PR#13812) crash when closing client while detached

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13812) crash when closing client while detached
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 29 Aug 2005 09:06:13 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13812 >

This patch fixes a crash in save_options when the client is detached.

-jason

Index: client/options.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/options.c,v
retrieving revision 1.141
diff -p -u -r1.141 options.c
--- client/options.c    25 Aug 2005 19:26:36 -0000      1.141
+++ client/options.c    29 Aug 2005 16:04:40 -0000
@@ -605,10 +605,12 @@ void save_options(void)
   }
   
   /* insert global worklists */
-  for(i = 0; i < MAX_NUM_WORKLISTS; i++){
-    if (game.player_ptr->worklists[i].is_valid) {
-      worklist_save(&sf, &(game.player_ptr->worklists[i]),
-                   "worklists.worklist%d", i);
+  if (game.player_ptr) {
+    for(i = 0; i < MAX_NUM_WORKLISTS; i++){
+      if (game.player_ptr->worklists[i].is_valid) {
+       worklist_save(&sf, &(game.player_ptr->worklists[i]),
+                     "worklists.worklist%d", i);
+      }
     }
   }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13812) crash when closing client while detached, Jason Short <=