Complete.Org: Mailing Lists: Archives: freeciv-dev: January 1999:
Re: [Freeciv-Dev] [mikon@xxxxxxxxxxxx: Bug#32426: freeciv: core at doubl
Home

Re: [Freeciv-Dev] [mikon@xxxxxxxxxxxx: Bug#32426: freeciv: core at doubl

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Lalo Martins <lalo@xxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, mikon@xxxxxxxxxxxx
Subject: Re: [Freeciv-Dev] [mikon@xxxxxxxxxxxx: Bug#32426: freeciv: core at double nation selection]
From: Nicolas BRUNEL <brunel@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Jan 1999 20:45:54 +0100 (CET)

> Package: freeciv
> Version: 1.7.2-3
> 
> When two race selection dialogs are generated, e.g. by disconnecting
> after the first has appeared, and connecting again, then the second try
> at nation selection will result in core dump.
>

I try to fix it by checking if a races_dailog_shell exist when
the connection to the server is lost.
If it exists, it is closed.

Bye, 
? races_dialog_shell.diff
Index: client/clinet.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/clinet.c,v
retrieving revision 1.8
diff -u -r1.8 clinet.c
--- clinet.c    1998/11/28 07:20:11     1.8
+++ clinet.c    1999/01/26 18:35:38
@@ -49,6 +49,7 @@
 #include <xmain.h>
 #include <chatline.h>
 #include <game.h>
+#include <packhand.h>
 extern Widget toplevel, main_form, menu_form, below_menu_form, 
left_column_form;
 
 struct connection aconnection;
@@ -152,6 +153,7 @@
     flog(LOG_NORMAL, "lost connection to server");
     close(*fid);
     remove_net_input();
+    popdown_races_dialog(); 
     set_client_state(CLIENT_PRE_GAME_STATE);
   }
 }
Index: client/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/dialogs.c,v
retrieving revision 1.19
diff -u -r1.19 dialogs.c
--- dialogs.c   1998/10/20 12:32:39     1.19
+++ dialogs.c   1999/01/26 18:35:40
@@ -47,7 +47,7 @@
 extern GC fill_bg_gc;
 
 /******************************************************************/
-Widget races_dialog_shell;
+Widget races_dialog_shell=NULL;
 Widget races_form, races_toggles_form, races_label;
 Widget races_ok_command;
 Widget races_toggles[14], races_name;
@@ -1450,8 +1450,11 @@
 *****************************************************************/
 void popdown_races_dialog(void)
 {
+  if (races_dialog_shell) {
   XtSetSensitive(main_form, TRUE);
   XtDestroyWidget(races_dialog_shell);
+  races_dialog_shell = NULL;
+  } /* else there is no dialog shell to destroy */
 }
 
 
@@ -1459,6 +1462,7 @@
 ...
 *****************************************************************/
 void create_races_dialog(void)
+ 
 {
   int i;
   XtTranslations textfieldtranslations;
@@ -1466,7 +1470,6 @@
   races_dialog_shell = XtCreatePopupShell("racespopup", 
                                          transientShellWidgetClass,
                                          toplevel, NULL, 0);
-
 
   races_form = XtVaCreateManagedWidget("racesform", 
                                       formWidgetClass, 
Index: client/packhand.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.h,v
retrieving revision 1.3
diff -u -r1.3 packhand.h
--- packhand.h  1998/07/29 13:29:54     1.3
+++ packhand.h  1999/01/26 18:35:40
@@ -7,4 +7,5 @@
 void handle_remove_unit(struct packet_generic_integer *packet);
 void handle_incite_cost(struct packet_generic_values *packet);
 
+void popdown_races_dialog(void);
 #endif

[Prev in Thread] Current Thread [Next in Thread]