[Freeciv-Dev] (PR#10996) 2.0.0-beta3 - segmentation fault
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10996 >
> [bugreports.malaire@xxxxxxxxxxxx - Sat Nov 13 08:46:12 2004]:
>
> When I start freeciv client, select "Start Scenario Game" or "Load
> Saved Game" and then "Browse...", client quits at once. If I started
> from commandline, I get message "Segmentation fault".
>
> This same happens with 2.0.0-beta2 and cvs-Nov-10.
>
> OS is SuSe 9.1 personal linux.
>
> I can provide additional information, such as version numbers of certain
> installed packages or something else, if someone tells me what
> information I should include.
There was some funny business around there. This patch should fix it.
Index: client/gui-gtk-2.0/connectdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/connectdlg.c,v
retrieving revision 1.52
diff -u -r1.52 connectdlg.c
--- client/gui-gtk-2.0/connectdlg.c 18 Oct 2004 23:49:27 -0000 1.52
+++ client/gui-gtk-2.0/connectdlg.c 14 Nov 2004 22:47:09 -0000
@@ -70,23 +70,20 @@
gchar *filename;
bool is_save = (bool)data;
- if (current_filename) {
- free(current_filename);
- }
-
filename = g_filename_to_utf8(
gtk_file_selection_get_filename(GTK_FILE_SELECTION(w)),
-1, NULL, NULL, NULL);
- current_filename = mystrdup(filename);
if (is_save) {
- send_save_game(current_filename);
+ send_save_game(filename);
} else {
char message[MAX_LEN_MSG];
- my_snprintf(message, sizeof(message), "/load %s", current_filename);
+ my_snprintf(message, sizeof(message), "/load %s", filename);
send_chat(message);
}
+
+ g_free(filename);
}
gtk_widget_destroy(w);
@@ -104,11 +101,6 @@
filesel = gtk_file_selection_new(title);
setup_dialog(filesel, toplevel);
gtk_window_set_position(GTK_WINDOW(filesel), GTK_WIN_POS_MOUSE);
-
- if (current_filename) {
- gtk_file_selection_set_filename(GTK_FILE_SELECTION(filesel),
- g_filename_from_utf8(current_filename, -1, NULL, NULL, NULL));
- }
g_signal_connect(filesel, "response",
G_CALLBACK(filesel_response_callback), (gpointer)is_save);
|
|