1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Export done_textarea_data and call in destroy_terminal to prevent leak

Previously, if a terminal crashed with an external editor open, the struct textarea_data would never be freed
This commit is contained in:
Miciah Dashiel Butler Masters 2007-09-01 09:45:56 +00:00 committed by Miciah Dashiel Butler Masters
parent 8dc000e313
commit 6469344727
3 changed files with 7 additions and 1 deletions

View File

@ -119,6 +119,11 @@ destroy_terminal(struct terminal *term)
bookmark_auto_save_tabs(term);
#endif
if (term->textarea_data) {
done_textarea_data(term->textarea_data);
term->textarea_data = NULL;
}
/* delete_window doesn't update term->current_tab, but it
calls redraw_terminal, which requires term->current_tab
to be valid if there are any tabs left. So set a value

View File

@ -599,7 +599,7 @@ init_textarea_data(struct terminal *term, struct form_state *fs,
return td;
}
static void
void
done_textarea_data(struct textarea_data *td)
{
mem_free(td->fn);

View File

@ -21,6 +21,7 @@ int area_cursor(struct form_control *fc, struct form_state *fs);
void draw_textarea(struct terminal *term, struct form_state *fs, struct document_view *doc_view, struct link *link);
unsigned char *encode_textarea(struct submitted_value *sv);
void done_textarea_data(struct textarea_data *td);
void textarea_edit(int, struct terminal *, struct form_state *, struct document_view *, struct link *);
void menu_textarea_edit(struct terminal *term, void *xxx, void *ses_);