<URL: http://bugs.freeciv.org/Ticket/Display.html?id=36865 >
> [dmarks - Do 01. Mär 2007, 06:44:18]:
>
> On 3/1/07, Christian Prochaska <[EMAIL PROTECTED]> wrote:
> >
> > <URL: http://bugs.freeciv.org/Ticket/Display.html?id=36865 >
> >
> > > [dmarks - So 25. Feb 2007, 07:37:04]:
> > >
> > > SDL client 2.1.0-beta3:
> > >
> > > If you have a window (i.e. dialog or report) open when leaving a game
> > > (server disconnect etc) and then enter a new game, the window from the
> > > earlier game will still be around.
> > >
> > > ~Daniel
> > >
> >
> > I couldn't reproduce it. What exactly did you do?
> >
> >
>
> It seems to affect the City Report window only.
>
> You can easily cause a client crash here if you try to access one of
> the cities in the report back in the main menu.
>
> ~Daniel
>
Ok, now I could see it. Patch attached.
Index: client/gui-sdl/cityrep.c
===================================================================
--- client/gui-sdl/cityrep.c (Revision 12710)
+++ client/gui-sdl/cityrep.c (Arbeitskopie)
@@ -47,6 +47,19 @@
/* ==================================================================== */
+void popdown_city_report_dialog()
+{
+ if (pCityRep) {
+ popdown_window_group_dialog(pCityRep->pBeginWidgetList,
+ pCityRep->pEndWidgetList);
+ FC_FREE(pCityRep->pScroll);
+ FC_FREE(pCityRep);
+
+ enable_and_redraw_find_city_button();
+ flush_dirty();
+ }
+}
+
static int city_report_windows_callback(struct widget *pWindow)
{
if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -58,19 +71,7 @@
static int exit_city_report_callback(struct widget *pWidget)
{
if (Main.event.button.button == SDL_BUTTON_LEFT) {
- if (pCityRep) {
- /* if (pUnits_Upg_Dlg) {
- del_group_of_widgets_from_gui_list(pUnits_Upg_Dlg->pBeginWidgetList,
- pUnits_Upg_Dlg->pEndWidgetList);
- FC_FREE(pUnits_Upg_Dlg);
- } */
- popdown_window_group_dialog(pCityRep->pBeginWidgetList,
- pCityRep->pEndWidgetList);
- FC_FREE(pCityRep->pScroll);
- FC_FREE(pCityRep);
- enable_and_redraw_find_city_button();
- flush_dirty();
- }
+ popdown_city_report_dialog();
}
return -1;
}
Index: client/gui-sdl/dialogs.c
===================================================================
--- client/gui-sdl/dialogs.c (Revision 12699)
+++ client/gui-sdl/dialogs.c (Arbeitskopie)
@@ -47,6 +47,7 @@
/* gui-sdl */
#include "chatline.h"
#include "citydlg.h"
+#include "cityrep.h"
#include "cma_fe.h"
#include "colors.h"
#include "finddlg.h"
@@ -158,6 +159,7 @@
popdown_meswin_dialog();
popdown_worklist_editor();
popdown_all_city_dialogs();
+ popdown_city_report_dialog();
popdown_economy_report_dialog();
popdown_activeunits_report_dialog();
popdown_intel_dialogs();
Index: client/gui-sdl/cityrep.h
===================================================================
--- client/gui-sdl/cityrep.h (Revision 12688)
+++ client/gui-sdl/cityrep.h (Arbeitskopie)
@@ -17,5 +17,6 @@
#include "cityrep_g.h"
bool is_city_report_open(void);
+void popdown_city_report_dialog(void);
#endif /* FC__CITYREP_H */
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev