mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 03:22: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:
@ -1,4 +1,4 @@
|
||||
/* $Id: macterm.c,v 1.49 2003/01/14 19:42:00 ben Exp $ */
|
||||
/* $Id: macterm.c,v 1.50 2003/01/15 23:30:21 ben Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1999 Simon Tatham
|
||||
* Copyright (c) 1999, 2002 Ben Harris
|
||||
@ -190,7 +190,7 @@ void mac_startsession(Session *s)
|
||||
|
||||
ShowWindow(s->window);
|
||||
s->next = sesslist;
|
||||
s->prev = s->next->prev;
|
||||
s->prev = &sesslist;
|
||||
if (s->next != NULL)
|
||||
s->next->prev = &s->next;
|
||||
sesslist = s;
|
||||
@ -917,6 +917,25 @@ static pascal void mac_growtermdraghook(void)
|
||||
SetPort(portsave);
|
||||
}
|
||||
|
||||
void mac_closeterm(WindowPtr window)
|
||||
{
|
||||
Session *s = (Session *)GetWRefCon(window);
|
||||
|
||||
/* XXX warn on close */
|
||||
HideWindow(s->window);
|
||||
*s->prev = s->next;
|
||||
s->next->prev = s->prev;
|
||||
ldisc_free(s->ldisc);
|
||||
s->back->free(s->backhandle);
|
||||
log_free(s->logctx);
|
||||
if (s->uni_to_font != NULL)
|
||||
DisposeUnicodeToTextInfo(&s->uni_to_font);
|
||||
term_free(s->term);
|
||||
DisposeWindow(s->window);
|
||||
DisposePalette(s->palette);
|
||||
sfree(s);
|
||||
}
|
||||
|
||||
void mac_activateterm(WindowPtr window, Boolean active) {
|
||||
Session *s;
|
||||
|
||||
|
Reference in New Issue
Block a user