Author: sveinung Date: Thu May 4 12:22:09 2017 New Revision: 35382 URL: http://svn.gna.org/viewcvs/freeciv?rev=35382&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: trunk/client/gui-gtk-3.0/unitselect.c trunk/client/gui-gtk-3.22/unitselect.c trunk/client/gui-gtk-4.0/unitselect.c Modified: trunk/client/gui-gtk-3.0/unitselect.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/unitselect.c?rev=35382&r1=35381&r2=35382&view=diff ============================================================================== --- trunk/client/gui-gtk-3.0/unitselect.c (original) +++ trunk/client/gui-gtk-3.0/unitselect.c Thu May 4 12:22:09 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: trunk/client/gui-gtk-3.22/unitselect.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.22/unitselect.c?rev=35382&r1=35381&r2=35382&view=diff ============================================================================== --- trunk/client/gui-gtk-3.22/unitselect.c (original) +++ trunk/client/gui-gtk-3.22/unitselect.c Thu May 4 12:22:09 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: trunk/client/gui-gtk-4.0/unitselect.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-4.0/unitselect.c?rev=35382&r1=35381&r2=35382&view=diff ============================================================================== --- trunk/client/gui-gtk-4.0/unitselect.c (original) +++ trunk/client/gui-gtk-4.0/unitselect.c Thu May 4 12:22:09 2017 @@ -693,10 +693,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