X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Ftessellimage.c;h=5fd681e1a35f10a2c8cffe4c7627eacc9335927e;hp=c506400cd5cd63a45936367d8fb46155a3af96ca;hb=dba664f31aa87285db4d76cf8c5e66335299703a;hpb=8afc01a67be4fbf3f1cc0fce9adf01b5289a21c6 diff --git a/hacks/tessellimage.c b/hacks/tessellimage.c index c506400c..5fd681e1 100644 --- a/hacks/tessellimage.c +++ b/hacks/tessellimage.c @@ -573,11 +573,12 @@ tessellate (struct state *st) if (ticked_p && st->cache[st->thresh]) { - XCopyArea (st->dpy, - st->cache[st->thresh], - st->output, st->pgc, - 0, 0, st->delta->width, st->delta->height, - 0, 0); + if (st->output) + XCopyArea (st->dpy, + st->cache[st->thresh], + st->output, st->pgc, + 0, 0, st->delta->width, st->delta->height, + 0, 0); } else if (ticked_p) { @@ -753,12 +754,13 @@ tessellate (struct state *st) fprintf (stderr, "%s: out of memory\n", progname); abort(); } - XCopyArea (st->dpy, - st->output, - st->cache[st->thresh], - st->pgc, - 0, 0, st->delta->width, st->delta->height, - 0, 0); + if (st->output) + XCopyArea (st->dpy, + st->output, + st->cache[st->thresh], + st->pgc, + 0, 0, st->delta->width, st->delta->height, + 0, 0); } } @@ -916,8 +918,8 @@ tessellimage_free (Display *dpy, Window window, void *closure) { struct state *st = (struct state *) closure; flush_cache (st); - XFreeGC (dpy, st->wgc); - XFreeGC (dpy, st->pgc); + if (st->wgc) XFreeGC (dpy, st->wgc); + if (st->pgc) XFreeGC (dpy, st->pgc); if (st->image) XFreePixmap (dpy, st->image); if (st->output) XFreePixmap (dpy, st->output); if (st->delta) XDestroyImage (st->delta);