From c1190260b27bab9d7ce68ff039c7658b9b839701 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 24 Jan 2007 13:53:28 +0000 Subject: [PATCH] The direct link between the terminal and the back end via term_provide_resize_fn() was not being broken when the back end was destroyed on session termination, causing resizing an inactive PuTTY to be a segfault hazard. git-svn-id: svn://svn.tartarus.org/sgt/putty@7143 cda61777-01e9-0310-a592-d414129be87e --- terminal.c | 2 +- unix/gtkwin.c | 1 + windows/window.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/terminal.c b/terminal.c index 92c3f032..f58941fa 100644 --- a/terminal.c +++ b/terminal.c @@ -1722,7 +1722,7 @@ void term_provide_resize_fn(Terminal *term, { term->resize_fn = resize_fn; term->resize_ctx = resize_ctx; - if (term->cols > 0 && term->rows > 0) + if (resize_fn && term->cols > 0 && term->rows > 0) resize_fn(resize_ctx, term->cols, term->rows); } diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 11c9c21d..d0b46931 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -1205,6 +1205,7 @@ void notify_remote_exit(void *frontend) inst->back->free(inst->backhandle); inst->backhandle = NULL; inst->back = NULL; + term_provide_resize_fn(inst->term, NULL, NULL); update_specials_menu(inst); } gtk_widget_show(inst->restartitem); diff --git a/windows/window.c b/windows/window.c index 824827a7..dca27a44 100644 --- a/windows/window.c +++ b/windows/window.c @@ -299,6 +299,7 @@ static void close_session(void) back->free(backhandle); backhandle = NULL; back = NULL; + term_provide_resize_fn(term, NULL, NULL); update_specials_menu(NULL); } -- 2.11.0