X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/88b3172a9144857696ed9425a0e66e5a11bdd927..58070d221740f21df8c354ab653c49a184d37ebf:/mac/macterm.c diff --git a/mac/macterm.c b/mac/macterm.c index 22360e14..443c0c8b 100644 --- a/mac/macterm.c +++ b/mac/macterm.c @@ -1015,7 +1015,7 @@ void mac_closeterm(WindowPtr window) int alertret; Session *s = mac_windowsession(window); - if (s->cfg.warn_on_close) { + if (s->cfg.warn_on_close && !s->session_closed) { ParamText("\pAre you sure you want to close this session?", NULL, NULL, NULL); alertret=CautionAlert(wQuestion, NULL); @@ -1028,8 +1028,10 @@ void mac_closeterm(WindowPtr window) HideWindow(s->window); *s->prev = s->next; s->next->prev = s->prev; - ldisc_free(s->ldisc); - s->back->free(s->backhandle); + if (s->ldisc) + ldisc_free(s->ldisc); + if (s->back) + s->back->free(s->backhandle); log_free(s->logctx); if (s->uni_to_font != NULL) DisposeUnicodeToTextInfo(&s->uni_to_font); @@ -1843,6 +1845,12 @@ void ldisc_update(void *frontend, int echo, int edit) { } +char *get_ttymode(void *frontend, const char *mode) +{ + Session *s = frontend; + return term_get_ttymode(s->term, mode); +} + /* * Mac PuTTY doesn't support printing yet. */