Author: cazfi
Date: Wed Sep  9 17:43:02 2015
New Revision: 29833

URL: http://svn.gna.org/viewcvs/freeciv?rev=29833&view=rev
Log:
Free overview canvas on exit.

See patch #6326

Modified:
    trunk/client/client_main.c
    trunk/client/overview_common.c
    trunk/client/overview_common.h

Modified: trunk/client/client_main.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/client_main.c?rev=29833&r1=29832&r2=29833&view=diff
==============================================================================
--- trunk/client/client_main.c  (original)
+++ trunk/client/client_main.c  Wed Sep  9 17:43:02 2015
@@ -682,9 +682,10 @@
   if (options.save_options_on_exit) {
     options_save();
   }
-  
+
+  overview_free();
   tileset_free(tileset);
-  
+
   ui_exit();
 
   script_client_free();

Modified: trunk/client/overview_common.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/overview_common.c?rev=29833&r1=29832&r2=29833&view=diff
==============================================================================
--- trunk/client/overview_common.c      (original)
+++ trunk/client/overview_common.c      Wed Sep  9 17:43:02 2015
@@ -489,6 +489,19 @@
 }
 
 /****************************************************************************
+  Free overview resources.
+****************************************************************************/
+void overview_free(void)
+{
+  if (options.overview.map) {
+    canvas_free(options.overview.map);
+    canvas_free(options.overview.window);
+    options.overview.map = NULL;
+    options.overview.window = NULL;
+  }
+}
+
+/****************************************************************************
   Callback to be called when an overview option is changed.
 ****************************************************************************/
 void overview_redraw_callback(struct option *option)

Modified: trunk/client/overview_common.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/overview_common.h?rev=29833&r1=29832&r2=29833&view=diff
==============================================================================
--- trunk/client/overview_common.h      (original)
+++ trunk/client/overview_common.h      Wed Sep  9 17:43:02 2015
@@ -41,6 +41,7 @@
 void refresh_overview_from_canvas(void);
 void overview_update_tile(struct tile *ptile);
 void calculate_overview_dimensions(void);
+void overview_free(void);
 
 void center_tile_overviewcanvas(void);
 


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to