X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=mac%2Fmacterm.c;h=d5a6014d1a2b258ab1541d6632916de6aff2f5cf;hb=8316deb3399fe1d0c406132cf2e795a76de26b64;hp=22360e146d97bce0a1616af3985df84d911aa54e;hpb=114b750d93652612f091d51663a5df7a4c0ff2a5;p=PuTTY.git diff --git a/mac/macterm.c b/mac/macterm.c index 22360e14..d5a6014d 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);