From 1e1df590891707c542dd40fa93067021ad82bf55 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 27 Mar 2015 15:27:33 +0000 Subject: 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. --- render/form.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'render/form.c') 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); -- cgit v1.2.3