Author: sveinung
Date: Thu May  4 12:22:37 2017
New Revision: 35383

URL: http://svn.gna.org/viewcvs/freeciv?rev=35383&view=rev
Log:
unitselect: don't create pix twice.

Delete the pre "Gtk3-client drawing code uses cairo" (gna patch #2715)
initialization of the variable pix in usdlg_tab_append_utype(). The original
patch had already deleted it from usdlg_tab_append_units(). No change is
therefore needed in usdlg_get_unit_image(), the current location of
usdlg_tab_append_units()'s unit drawing code.

This fixes a memory leak. (Detectable with Valgrind.)

Reported by Marko Lindqvist <cazfi>

See gna bug #25246

Modified:
    branches/S3_0/client/gui-gtk-3.0/unitselect.c
    branches/S3_0/client/gui-gtk-3.22/unitselect.c

Modified: branches/S3_0/client/gui-gtk-3.0/unitselect.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.0/unitselect.c?rev=35383&r1=35382&r2=35383&view=diff
==============================================================================
--- branches/S3_0/client/gui-gtk-3.0/unitselect.c       (original)
+++ branches/S3_0/client/gui-gtk-3.0/unitselect.c       Thu May  4 12:22:37 2017
@@ -690,10 +690,6 @@
   gtk_tree_store_append(GTK_TREE_STORE(store), it, NULL);
 
   /* Create a icon */
-  pix = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8,
-                       tileset_full_tile_width(tileset),
-                       tileset_full_tile_height(tileset));
-
   {
     struct canvas canvas_store = FC_STATIC_CANVAS_INIT;
 

Modified: branches/S3_0/client/gui-gtk-3.22/unitselect.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-gtk-3.22/unitselect.c?rev=35383&r1=35382&r2=35383&view=diff
==============================================================================
--- branches/S3_0/client/gui-gtk-3.22/unitselect.c      (original)
+++ branches/S3_0/client/gui-gtk-3.22/unitselect.c      Thu May  4 12:22:37 2017
@@ -690,10 +690,6 @@
   gtk_tree_store_append(GTK_TREE_STORE(store), it, NULL);
 
   /* Create a icon */
-  pix = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8,
-                       tileset_full_tile_width(tileset),
-                       tileset_full_tile_height(tileset));
-
   {
     struct canvas canvas_store = FC_STATIC_CANVAS_INIT;
 


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

Reply via email to