diff options
author | Jesse Luehrs <doy@tozt.net> | 2016-06-05 07:19:55 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2016-06-05 07:19:55 -0400 |
commit | eb7e60537c7047a96f036efa09c735eb8f572600 (patch) | |
tree | c9d0609ad759647c7e6e114b7edc91e282278fa8 | |
parent | e7d37f8abb44b048a43caff70c033456ec65d388 (diff) | |
download | runes-eb7e60537c7047a96f036efa09c735eb8f572600.tar.gz runes-eb7e60537c7047a96f036efa09c735eb8f572600.zip |
avoid a race condition if the window closes while we're double clicking
-rw-r--r-- | src/window-xlib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/window-xlib.c b/src/window-xlib.c index cc7da43..0030f4f 100644 --- a/src/window-xlib.c +++ b/src/window-xlib.c @@ -1081,8 +1081,10 @@ static void runes_window_handle_multi_click(RunesTerm *t, XButtonEvent *e) if (w->multi_click_timer_event) { runes_loop_timer_clear(t->loop, w->multi_click_timer_event); + runes_term_refcnt_dec(t); } + runes_term_refcnt_inc(t); w->multi_click_timer_event = runes_loop_timer_set( t->loop, t->config->double_click_rate, t, runes_window_multi_click_cb); @@ -1200,6 +1202,7 @@ static void runes_window_multi_click_cb(void *t) w->multi_clicks = 0; w->multi_click_timer_event = NULL; + runes_term_refcnt_dec(t); } static struct function_key *runes_window_find_key_sequence( |