From eb7e60537c7047a96f036efa09c735eb8f572600 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 5 Jun 2016 07:19:55 -0400 Subject: avoid a race condition if the window closes while we're double clicking --- src/window-xlib.c | 3 +++ 1 file changed, 3 insertions(+) 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( -- cgit v1.2.3-54-g00ecf