aboutsummaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/degesch.c b/degesch.c
index cbb20d3..dc9427e 100644
--- a/degesch.c
+++ b/degesch.c
@@ -397,6 +397,9 @@ input_destroy_buffer (struct input *self, struct input_buffer *buffer)
history_set_history_state (buffer->history);
rl_clear_history ();
+ // rl_clear_history just removes history entries,
+ // we have to reclaim memory for their actual container ourselves
+ free (buffer->history->entries);
free (buffer->history);
buffer->history = NULL;
@@ -1338,9 +1341,14 @@ app_context_free (struct app_context *self)
for (size_t i = 0; i < ATTR_COUNT; i++)
free (self->attrs[i]);
- // FIXME: this doesn't free the history state
LIST_FOR_EACH (struct buffer, iter, self->buffers)
+ {
+#ifdef HAVE_READLINE
+ input_destroy_buffer (&self->input, iter->input_data);
+ iter->input_data = NULL;
+#endif // HAVE_READLINE
buffer_destroy (iter);
+ }
str_map_free (&self->buffers_by_name);
str_map_free (&self->servers);