[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]
<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 <=
|
|