From bcb7a09eacc8389f496e3365cfad0ad087c1f3cb Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Wed, 14 Jun 2023 23:15:18 +0200 Subject: [PATCH] i9e: Clear history on close. This frees each history entry and the history itself, reducing the amount of memory leaked by readline applications on exit. Normally, this should not be used since it leaks the memory associated with the user defined history data pointer of each entry. However, that's OK here because the i9e subsystem ignores this feature of the history library. --- interactive.c | 1 + 1 file changed, 1 insertion(+) diff --git a/interactive.c b/interactive.c index 1376cf1d..4d48742f 100644 --- a/interactive.c +++ b/interactive.c @@ -229,6 +229,7 @@ void i9e_close(void) rl_callback_handler_remove(); if (hf) write_history(hf); + clear_history(); wipe_bottom_line(); fcntl(i9ep->ici->fds[0], F_SETFL, i9ep->fd_flags[0]); fcntl(i9ep->ici->fds[1], F_SETFL, i9ep->fd_flags[1]); -- 2.39.5