Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2006:
[Freeciv-Dev] (PR#16010) cursors crash when leaving game
Home

[Freeciv-Dev] (PR#16010) cursors crash when leaving game

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#16010) cursors crash when leaving game
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 24 Mar 2006 16:41:53 -0800
Reply-to: bugs@xxxxxxxxxxx

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

The cursor-fixing bug I fixed introduced a new bug, causing the gtk2
client to crash when leaving a game.  The core issue here is that
leave_mapcanvas is a very fuzzy function.

This patch fixes the new crash.

-jason 
Index: client/gui-gtk-2.0/mapctrl.c
===================================================================
--- client/gui-gtk-2.0/mapctrl.c        (revision 11787)
+++ client/gui-gtk-2.0/mapctrl.c        (working copy)
@@ -399,7 +399,8 @@
    * the map canvas, for instance, it gets called any time the mouse is
    * clicked. */
   gdk_window_get_pointer(map_canvas->window, &canvas_x, &canvas_y, NULL);
-  if (canvas_x >= 0 && canvas_y >= 0
+  if (map_exists()
+      && canvas_x >= 0 && canvas_y >= 0
       && canvas_x < mapview.width && canvas_y < mapview.height) {
     handle_mouse_cursor(canvas_pos_to_tile(canvas_x, canvas_y));
   } else {
Index: client/climap.h
===================================================================
--- client/climap.h     (revision 11787)
+++ client/climap.h     (working copy)
@@ -17,7 +17,7 @@
 #include "map.h"                /* enum direction8 */
 #include "terrain.h"            /* enum known_type */
 
-#define map_exists() (map.xsize != 0)
+#define map_exists() (map.tiles != NULL)
 
 enum known_type client_tile_get_known(const struct tile *ptile);
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#16010) cursors crash when leaving game, Jason Short <=