From f040b6f10067da1d629695c095e8b6e8d6904453 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Sun, 2 Jul 2006 03:28:51 +0000 Subject: [PATCH] Fix crash when exiting after disabling the mouse Add guards to return if the mouse is enabled or disabled in disable_mouse and enable_mouse, respectively. --- src/terminal/mouse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/terminal/mouse.c b/src/terminal/mouse.c index e90e0fdab..2cf2f837c 100644 --- a/src/terminal/mouse.c +++ b/src/terminal/mouse.c @@ -75,6 +75,8 @@ disable_mouse(void) { int h = get_output_handle(); /* XXX: Is this all right? -- Miciah */ + if (!mouse_enabled) return; + unhandle_mouse(ditrm->mouse_h); if (is_xterm()) send_mouse_done_sequence(h); @@ -86,6 +88,8 @@ enable_mouse(void) { int h = get_output_handle(); /* XXX: Is this all right? -- Miciah */ + if (mouse_enabled) return; + if (is_xterm()) send_mouse_init_sequence(h); ditrm->mouse_h = handle_mouse(0, (void (*)(void *, unsigned char *, int)) itrm_queue_event, ditrm);