diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-03-27 15:27:33 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-03-27 15:27:33 +0000 |
commit | 1e1df590891707c542dd40fa93067021ad82bf55 (patch) | |
tree | d6b9eba1c0c1d2f9b77c5ef137ab4a7e833e3ad7 | |
parent | 6f4f860ce3c6a569b15dce17b8d459636c936993 (diff) | |
download | netsurf-1e1df590891707c542dd40fa93067021ad82bf55.tar.gz netsurf-1e1df590891707c542dd40fa93067021ad82bf55.tar.bz2 |
add some debug to form gadget freeing
Serveral reports of form freeing segfaulting on RISC OS so this adds
some debug in this area to see if we can tell why.
-rw-r--r-- | render/form.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/render/form.c b/render/form.c index 73eee3e0d..a2b661e39 100644 --- a/render/form.c +++ b/render/form.c @@ -215,6 +215,9 @@ void form_add_control(struct form *form, struct form_control *control) */ void form_free_control(struct form_control *control) { + assert(control != NULL); + + LOG(("Control:%p name:%p value:%p initial:%p", control, control->name, control->value, control->initial_value)); free(control->name); free(control->value); free(control->initial_value); @@ -225,23 +228,27 @@ void form_free_control(struct form_control *control) for (option = control->data.select.items; option; option = next) { next = option->next; + LOG(("select option:%p text:%p value:%p", option, option->text, option->value)); free(option->text); free(option->value); free(option); } - if (control->data.select.menu != NULL) + if (control->data.select.menu != NULL) { form_free_select_menu(control); + } } if (control->type == GADGET_TEXTAREA || control->type == GADGET_TEXTBOX || control->type == GADGET_PASSWORD) { - if (control->data.text.initial != NULL) + if (control->data.text.initial != NULL) { dom_string_unref(control->data.text.initial); + } - if (control->data.text.ta != NULL) + if (control->data.text.ta != NULL) { textarea_destroy(control->data.text.ta); + } } free(control); |