]> git.tue.mpg.de Git - paraslash.git/commitdiff
i9e: Clear history on close.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 14 Jun 2023 21:15:18 +0000 (23:15 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 31 Aug 2024 18:31:37 +0000 (20:31 +0200)
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

index 1376cf1d72739b3f7c9c3218dd96666a5d475812..4d48742f686862bb8d5fe8871116925309dbc978 100644 (file)
@@ -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]);