mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Add the ability to close sessions. This adds *_free() functions to most
areas of the code. Not all back-ends have been tested, but Telnet and SSH behave reasonably. Incidentally, almost all of this patch was written through Mac PuTTY, admittedly over a Telnet connection. [originally from svn r2615]
This commit is contained in:
28
terminal.c
28
terminal.c
@ -391,6 +391,34 @@ Terminal *term_init(Config *mycfg, struct unicode_data *ucsdata,
|
||||
return term;
|
||||
}
|
||||
|
||||
void term_free(Terminal *term)
|
||||
{
|
||||
unsigned long *line;
|
||||
struct beeptime *beep;
|
||||
|
||||
while ((line = delpos234(term->scrollback, 0)) != NULL)
|
||||
sfree(line);
|
||||
freetree234(term->scrollback);
|
||||
while ((line = delpos234(term->screen, 0)) != NULL)
|
||||
sfree(line);
|
||||
freetree234(term->screen);
|
||||
while ((line = delpos234(term->alt_screen, 0)) != NULL)
|
||||
sfree(line);
|
||||
freetree234(term->alt_screen);
|
||||
sfree(term->disptext);
|
||||
while (term->beephead) {
|
||||
beep = term->beephead;
|
||||
term->beephead = beep->next;
|
||||
sfree(beep);
|
||||
}
|
||||
bufchain_clear(&term->inbuf);
|
||||
if(term->print_job)
|
||||
printer_finish_job(term->print_job);
|
||||
bufchain_clear(&term->printer_buf);
|
||||
sfree(term->paste_buffer);
|
||||
sfree(term);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up the terminal for a given size.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user