Index: trunk/src/plugins/target_spice/target_spice.c =================================================================== --- trunk/src/plugins/target_spice/target_spice.c (revision 10280) +++ trunk/src/plugins/target_spice/target_spice.c (revision 10281) @@ -836,12 +836,19 @@ return 0; } +static int on_unload(fgw_obj_t *obj) +{ + spicelib_ctx_t *ctx = obj->script_data; + ldch_uninit(&ctx->spicelibs); + free(ctx); +} + static const fgw_eng_t fgw_target_spice_eng = { "target_spice", csch_c_call_script, NULL, on_load, - NULL, /* on_unload */ + on_unload }; static rnd_action_t spicelib_action_list[] = {