Fix crash on animation after resizing
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 28 Oct 2012 17:16:20 +0000 (18:16 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Sun, 28 Oct 2012 17:43:05 +0000 (18:43 +0100)
The animate buffers were still holding pointers to a discarded cairo surface.

draw.c

diff --git a/draw.c b/draw.c
index 99203b9..2d06ec1 100644 (file)
--- a/draw.c
+++ b/draw.c
@@ -772,7 +772,9 @@ DrawBlank (AnimNr anr, int x, int y, int startColor)
 void CopyRectangle (AnimNr anr, int srcBuf, int destBuf,
                 int srcX, int srcY, int width, int height, int destX, int destY)
 {
-       cairo_t *cr = cairo_create (c_animBufs[anr+destBuf]);
+       cairo_t *cr;
+       c_animBufs[anr+4] = csBoardWindow;
+       cr = cairo_create (c_animBufs[anr+destBuf]);
        cairo_set_source_surface (cr, c_animBufs[anr+srcBuf], destX - srcX, destY - srcY);
        cairo_rectangle (cr, destX, destY, width, height);
        cairo_fill (cr);