Branch: Tag:

2000-09-28

2000-09-28 15:37:25 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Delay unload of dynamic modules until all objects are gone.
Fixes spurious SIGSEGVs from do_gc().

Rev: src/dynamic_load.c:1.45
Rev: src/dynamic_load.h:1.4
Rev: src/main.c:1.102

8:   # include "pike_macros.h"   # include "main.h"    - RCSID("$Id: dynamic_load.c,v 1.44 2000/09/27 01:21:21 hubbe Exp $"); + RCSID("$Id: dynamic_load.c,v 1.45 2000/09/28 15:37:23 grubba Exp $");      #endif /* !TESTING */   
341:   #endif   }    + /* Call the pike_module_exit() callbacks for the dynamic modules. */   void exit_dynamic_load(void)   {   #if defined(HAVE_DLOPEN) || defined(USE_DLD) || defined(USE_HPUX_DL)
349: Inside #if defined(HAVE_DLOPEN) || defined(USE_DLD) || defined(USE_HPUX_DL)
   struct module_list *tmp=dynamic_module_list;    dynamic_module_list=tmp->next;    (*tmp->exit)(); +  } + #endif + } +  + /* Unload all the dynamically loaded modules. */ + void free_dynamic_load(void) + { + #if defined(HAVE_DLOPEN) || defined(USE_DLD) || defined(USE_HPUX_DL) +  while(dynamic_module_list) +  { +  struct module_list *tmp=dynamic_module_list; +  dynamic_module_list=tmp->next;   #ifndef DEBUG_MALLOC    dlclose(tmp->module);   #endif