Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 15920) +++ trunk/src/main.c (revision 15921) @@ -55,6 +55,7 @@ #include "flag_str.h" #include "plugins.h" #include "plug_footprint.h" +#include "plug_import.h" #include "event.h" #include "funchash.h" #include "conf.h" @@ -274,6 +275,7 @@ pcb_io_uninit(); pcb_plugin_uninit(); pcb_file_loaded_uninit(); + pcb_import_uninit(); } static int arg_match(const char *in, const char *shrt, const char *lng) Index: trunk/src/plug_footprint.c =================================================================== --- trunk/src/plug_footprint.c (revision 15920) +++ trunk/src/plug_footprint.c (revision 15921) @@ -91,6 +91,10 @@ void pcb_fp_uninit() { htsp_entry_t *e; + + if (pcb_plug_fp_chain != NULL) + pcb_message(PCB_MSG_ERROR, "pcb_plug_fp_chain is not empty; a plugin did not remove itself from the chain. Fix your plugins!\n"); + pcb_fp_free_children(&pcb_library); if (fp_tags != NULL) { for (e = htsp_first(fp_tags); e; e = htsp_next(fp_tags, e)) Index: trunk/src/plug_import.c =================================================================== --- trunk/src/plug_import.c (revision 15920) +++ trunk/src/plug_import.c (revision 15921) @@ -118,3 +118,9 @@ { return pcb_import(filename, IMPORT_ASPECT_NETLIST); } + +void pcb_import_uninit(void) +{ + if (pcb_plug_import_chain != NULL) + pcb_message(PCB_MSG_ERROR, "pcb_plug_import_chain is not empty; a plugin did not remove itself from the chain. Fix your plugins!\n"); +} Index: trunk/src/plug_import.h =================================================================== --- trunk/src/plug_import.h (revision 15920) +++ trunk/src/plug_import.h (revision 15921) @@ -56,6 +56,8 @@ extern pcb_plug_import_t *pcb_plug_import_chain; +void pcb_import_uninit(void); + /********** hook wrappers **********/ int pcb_import(char *filename, unsigned int aspect); int pcb_import_netlist(char *); Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 15920) +++ trunk/src/plug_io.c (revision 15921) @@ -1088,6 +1088,8 @@ void pcb_io_uninit(void) { + if (pcb_plug_io_chain != NULL) + pcb_message(PCB_MSG_ERROR, "pcb_plug_io_chain is not empty; a plugin did not remove itself from the chain. Fix your plugins!\n"); free(last_design_dir); last_design_dir = NULL; }