+2003-07-31 Kenichi Handa <handa@m17n.org>
+
+ * xterm.h (struct x_bitmap_record): New member have_mask.
+
+ * xfns.c (x_create_bitmap_from_data): Initialize have_mask member
+ to 0.
+ (x_create_bitmap_from_file): Likewise.
+ (x_destroy_bitmap): Check have_mask member before freeing a mask.
+ (x_destroy_all_bitmaps): Likewise.
+ (x_create_bitmap_mask): Set have_mask member to 1.
+
2003-07-30 Richard M. Stallman <rms@gnu.org>
* Makefile.in (CFLAGS) [!OPTIMIZE]: Undo previous change.
id = x_allocate_bitmap_record (f);
dpyinfo->bitmaps[id - 1].pixmap = bitmap;
+ dpyinfo->bitmaps[id - 1].have_mask = 0;
dpyinfo->bitmaps[id - 1].file = NULL;
dpyinfo->bitmaps[id - 1].refcount = 1;
dpyinfo->bitmaps[id - 1].depth = 1;
id = x_allocate_bitmap_record (f);
dpyinfo->bitmaps[id - 1].pixmap = bitmap;
+ dpyinfo->bitmaps[id - 1].have_mask = 0;
dpyinfo->bitmaps[id - 1].refcount = 1;
dpyinfo->bitmaps[id - 1].file
= (char *) xmalloc (SBYTES (file) + 1);
{
BLOCK_INPUT;
XFreePixmap (FRAME_X_DISPLAY (f), dpyinfo->bitmaps[id - 1].pixmap);
- XFreePixmap (FRAME_X_DISPLAY (f), dpyinfo->bitmaps[id - 1].mask);
+ if (dpyinfo->bitmaps[id - 1].have_mask)
+ XFreePixmap (FRAME_X_DISPLAY (f), dpyinfo->bitmaps[id - 1].mask);
if (dpyinfo->bitmaps[id - 1].file)
{
xfree (dpyinfo->bitmaps[id - 1].file);
if (dpyinfo->bitmaps[i].refcount > 0)
{
XFreePixmap (dpyinfo->display, dpyinfo->bitmaps[i].pixmap);
- XFreePixmap (dpyinfo->display, dpyinfo->bitmaps[i].mask);
+ if (dpyinfo->bitmaps[i].have_mask)
+ XFreePixmap (dpyinfo->display, dpyinfo->bitmaps[i].mask);
if (dpyinfo->bitmaps[i].file)
xfree (dpyinfo->bitmaps[i].file);
}
width, height);
XFreeGC (FRAME_X_DISPLAY (f), gc);
+ dpyinfo->bitmaps[id - 1].have_mask = 1;
dpyinfo->bitmaps[id - 1].mask = mask;
XDestroyImage (ximg);