X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/6f3370a03ed6393c049a13b78d2188135624beea..7d22e9b256ff8fa58b3d2e6ea74102e43f52a0c7:/terminal.c diff --git a/terminal.c b/terminal.c index ed3563dc..72bfbc9b 100644 --- a/terminal.c +++ b/terminal.c @@ -1065,32 +1065,32 @@ static termline *lineptr(Terminal *term, int y, int lineno, int screen) static void term_schedule_tblink(Terminal *term); static void term_schedule_cblink(Terminal *term); -static void term_timer(void *ctx, long now) +static void term_timer(void *ctx, unsigned long now) { Terminal *term = (Terminal *)ctx; int update = FALSE; - if (term->tblink_pending && now - term->next_tblink >= 0) { + if (term->tblink_pending && now == term->next_tblink) { term->tblinker = !term->tblinker; term->tblink_pending = FALSE; term_schedule_tblink(term); update = TRUE; } - if (term->cblink_pending && now - term->next_cblink >= 0) { + if (term->cblink_pending && now == term->next_cblink) { term->cblinker = !term->cblinker; term->cblink_pending = FALSE; term_schedule_cblink(term); update = TRUE; } - if (term->in_vbell && now - term->vbell_end >= 0) { + if (term->in_vbell && now == term->vbell_end) { term->in_vbell = FALSE; update = TRUE; } if (update || - (term->window_update_pending && now - term->next_update >= 0)) + (term->window_update_pending && now == term->next_update)) term_update(term); } @@ -1619,10 +1619,14 @@ void term_free(Terminal *term) for (i = 0; i < term->bidi_cache_size; i++) { sfree(term->pre_bidi_cache[i].chars); sfree(term->post_bidi_cache[i].chars); + sfree(term->post_bidi_cache[i].forward); + sfree(term->post_bidi_cache[i].backward); } sfree(term->pre_bidi_cache); sfree(term->post_bidi_cache); + sfree(term->tabs); + expire_timer_context(term); conf_free(term->conf); @@ -1711,7 +1715,8 @@ void term_size(Terminal *term, int newrows, int newcols, int newsavelines) while (term->rows > newrows) { if (term->curs.y < term->rows - 1) { /* delete bottom row, unless it contains the cursor */ - sfree(delpos234(term->screen, term->rows - 1)); + line = delpos234(term->screen, term->rows - 1); + freeline(line); } else { /* push top row to scrollback */ line = delpos234(term->screen, 0);