1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

Add free_textarea_data wrapper for done_textarea_data and use in destroy_terminal

Unexport done_textarea_data.
This commit is contained in:
Miciah Dashiel Butler Masters 2007-09-01 11:58:09 +00:00 committed by Miciah Dashiel Butler Masters
parent 6469344727
commit ac230ebc08
3 changed files with 12 additions and 6 deletions

View File

@ -119,10 +119,7 @@ destroy_terminal(struct terminal *term)
bookmark_auto_save_tabs(term); bookmark_auto_save_tabs(term);
#endif #endif
if (term->textarea_data) { free_textarea_data(term);
done_textarea_data(term->textarea_data);
term->textarea_data = NULL;
}
/* delete_window doesn't update term->current_tab, but it /* delete_window doesn't update term->current_tab, but it
calls redraw_terminal, which requires term->current_tab calls redraw_terminal, which requires term->current_tab

View File

@ -599,13 +599,22 @@ init_textarea_data(struct terminal *term, struct form_state *fs,
return td; return td;
} }
void static void
done_textarea_data(struct textarea_data *td) done_textarea_data(struct textarea_data *td)
{ {
mem_free(td->fn); mem_free(td->fn);
mem_free(td); mem_free(td);
} }
void
free_textarea_data(struct terminal *term)
{
assert(term);
if (term->textarea_data)
done_textarea_data(term->textarea_data);
}
void void
textarea_edit(int op, struct terminal *term_, struct form_state *fs_, textarea_edit(int op, struct terminal *term_, struct form_state *fs_,
struct document_view *doc_view_, struct link *link_) struct document_view *doc_view_, struct link *link_)

View File

@ -21,7 +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); 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); unsigned char *encode_textarea(struct submitted_value *sv);
void done_textarea_data(struct textarea_data *td); void free_textarea_data(struct terminal *term);
void textarea_edit(int, struct terminal *, struct form_state *, struct document_view *, struct link *); 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_); void menu_textarea_edit(struct terminal *term, void *xxx, void *ses_);