--- rxvt-unicode/src/screen.C 2012/05/28 21:13:36 1.418 +++ rxvt-unicode/src/screen.C 2012/06/28 15:19:15 1.422 @@ -171,7 +171,7 @@ int all_rows = total_rows + nrow + nrow; chunk_size = (sizeof (line_t) + rsize + tsize) * all_rows; - chunk = rxvt_malloc (chunk_size); + chunk = chunk_alloc (chunk_size, 0); char *base = (char *)chunk + sizeof (line_t) * all_rows; @@ -238,7 +238,7 @@ if (!prev_row_buf) { /* - * first time called so just malloc everything: don't rely on realloc + * first time called (or after scr_release) so just malloc everything: don't rely on realloc */ top_row = 0; term_start = 0; @@ -428,15 +428,15 @@ HOOK_INVOKE ((this, HOOK_RESET, DT_END)); } -/* ------------------------------------------------------------------------- */ -/* - * Free everything. That way malloc debugging can find leakage. - */ void ecb_cold rxvt_term::scr_release () NOTHROW { - free (chunk); + chunk_free (chunk, chunk_size); + chunk = 0; + row_buf = 0; + free (tabs); + tabs = 0; } /* ------------------------------------------------------------------------- */ @@ -448,8 +448,6 @@ { scr_release (); - row_buf = 0; - tabs = 0; prev_nrow = prev_ncol = 0; rvideo_mode = false; scr_soft_reset (); @@ -1710,7 +1708,7 @@ ::swap (pix_colors[Color_fg], pix_colors[Color_bg]); #ifdef HAVE_BG_PIXMAP - if (bg_pixmap == None) + if (bg_img == 0) #endif XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); @@ -2055,7 +2053,7 @@ unsigned int old_screen_flags = screen.flags; bool have_bg = 0; #ifdef HAVE_BG_PIXMAP - have_bg = bg_pixmap != None; + have_bg = bg_img != 0; #endif ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ @@ -2536,12 +2534,12 @@ bool transparent = false; #ifdef HAVE_BG_PIXMAP - if (bg_pixmap != None) + if (bg_img != 0) { -# ifdef ENABLE_TRANSPARENCY +# if ENABLE_TRANSPARENCY if (bg_flags & BG_IS_TRANSPARENT) { - XSetWindowBackgroundPixmap (dpy, parent, bg_pixmap); + XSetWindowBackgroundPixmap (dpy, parent, bg_img->pm); XSetWindowBackgroundPixmap (dpy, vt, ParentRelative); transparent = true; @@ -2550,7 +2548,7 @@ # endif { XSetWindowBackground (dpy, parent, pix_colors[Color_border]); - XSetWindowBackgroundPixmap (dpy, vt, bg_pixmap); + XSetWindowBackgroundPixmap (dpy, vt, bg_img->pm); } } else @@ -3534,7 +3532,7 @@ } /* ------------------------------------------------------------------------- */ -#ifdef USE_XIM +#if USE_XIM void ecb_cold rxvt_term::im_set_position (XPoint &pos) NOTHROW {