- 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);
- 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);
- 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);
if (st->image) XFreePixmap (dpy, st->image);
if (st->output) XFreePixmap (dpy, st->output);
if (st->delta) XDestroyImage (st->delta);