Index: trunk/src_plugins/order/order.c =================================================================== --- trunk/src_plugins/order/order.c (revision 27483) +++ trunk/src_plugins/order/order.c (revision 27484) @@ -100,7 +100,22 @@ pcb_gui->create_menu(pcb_gui, path, &props); } +void pcb_order_free_field_data(order_ctx_t *octx, pcb_order_field_t *f) +{ + if (f->enum_vals != NULL) { + char **s; + for(s = f->enum_vals; *s != NULL; s++) + free(s); + free(f->enum_vals); + f->enum_vals = NULL; + } + if (f->val.str != NULL) { + free(f->val.str); + f->val.str = NULL; + } +} + static void order_menu_init(pcb_hidlib_t *hidlib, void *user_data, int argc, pcb_event_arg_t argv[]) { pcb_hid_cfg_map_anchor_menus(ANCH, order_install_menu, NULL); Index: trunk/src_plugins/order/order.h =================================================================== --- trunk/src_plugins/order/order.h (revision 27483) +++ trunk/src_plugins/order/order.h (revision 27484) @@ -68,4 +68,9 @@ void pcb_order_dad_field(order_ctx_t *octx, pcb_order_field_t *f); +/* Free data stored in a field, but not the field itself. Note: ->name and + ->type remains valid after the call */ +void pcb_order_free_field_data(order_ctx_t *octx, pcb_order_field_t *f); + + #endif