aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-25 21:47:52 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-25 21:47:52 -0400
commit331891d3a2ed706bc0d9fb095f6f90db91e0ed20 (patch)
tree993b631e72a9c52bee220f8c75f9f305a2577f19
parent9491ce7f692555517af50eab2debf5d7418272e9 (diff)
downloadrunes-331891d3a2ed706bc0d9fb095f6f90db91e0ed20.tar.gz
runes-331891d3a2ed706bc0d9fb095f6f90db91e0ed20.zip
you can't just free uv handles, you have to close them first
this fixes some memory corruption
-rw-r--r--src/window-xlib.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/window-xlib.c b/src/window-xlib.c
index 85864e3..9b97c43 100644
--- a/src/window-xlib.c
+++ b/src/window-xlib.c
@@ -85,6 +85,7 @@ static void runes_window_backend_resize_window(
static void runes_window_backend_flush(RunesTerm *t);
static void runes_window_backend_visual_bell(RunesTerm *t);
static void runes_window_backend_reset_visual_bell(uv_timer_t *handle);
+static void runes_window_backend_visual_bell_free_handle(uv_handle_t *handle);
static void runes_window_backend_audible_bell(RunesTerm *t);
static void runes_window_backend_draw_cursor(RunesTerm *t);
static void runes_window_backend_set_urgent(RunesTerm *t);
@@ -505,6 +506,12 @@ static void runes_window_backend_reset_visual_bell(uv_timer_t *handle)
runes_window_backend_request_flush(t);
t->visual_bell_is_ringing = 0;
+ uv_close(
+ (uv_handle_t *)handle, runes_window_backend_visual_bell_free_handle);
+}
+
+static void runes_window_backend_visual_bell_free_handle(uv_handle_t *handle)
+{
free(handle);
}