From: H.G.Muller Date: Wed, 2 Mar 2016 14:18:58 +0000 (+0100) Subject: Fix crash on changing piece directory X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=cd95c02af6cdc2f9da9ee9f7914d2d49912f9fdb;p=xboard.git Fix crash on changing piece directory The loop for deleting the old pieces in ActivateTheme was still assuming the four promo-Golds were stored behind the normal set, which for the new piece ordering isn't the case anymore. --- diff --git a/draw.c b/draw.c index fca16eb..16c4b0d 100644 --- a/draw.c +++ b/draw.c @@ -109,7 +109,7 @@ cairo_surface_t *csBoardWindow; static cairo_surface_t *pngPieceImages[2][(int)BlackPawn]; // png 256 x 256 images static cairo_surface_t *pngPieceBitmaps[2][(int)BlackPawn]; // scaled pieces as used static cairo_surface_t *pngPieceBitmaps2[2][(int)BlackPawn]; // scaled pieces in store -static RsvgHandle *svgPieces[2][(int)BlackPawn+4]; // vector pieces in store +static RsvgHandle *svgPieces[2][(int)BlackPawn]; // vector pieces in store static cairo_surface_t *pngBoardBitmap[2], *pngOriginalBoardBitmap[2]; int useTexture, textureW[2], textureH[2]; @@ -451,7 +451,7 @@ InitDrawingParams (int reloadPieces) { int i, p; if(reloadPieces) - for(i=0; i<2; i++) for(p=0; p