~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add WS_VSCROLL style to drop-down non-combo boxes, to add a scroll bar
[sgt/putty]
/
mac
/
macterm.c
diff --git
a/mac/macterm.c
b/mac/macterm.c
index
78efa65
..
d5a6014
100644
(file)
--- a/
mac/macterm.c
+++ b/
mac/macterm.c
@@
-1012,14
+1012,26
@@
static pascal void mac_growtermdraghook(void)
void mac_closeterm(WindowPtr window)
{
void mac_closeterm(WindowPtr window)
{
+ int alertret;
Session *s = mac_windowsession(window);
Session *s = mac_windowsession(window);
- /* XXX 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);
+ if (alertret == 2) {
+ /* Cancel */
+ return;
+ }
+ }
+
HideWindow(s->window);
*s->prev = s->next;
s->next->prev = s->prev;
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);
log_free(s->logctx);
if (s->uni_to_font != NULL)
DisposeUnicodeToTextInfo(&s->uni_to_font);