From feef140cd08e6ed3d2cb683df8b71efb6d95fe0b Mon Sep 17 00:00:00 2001 From: Martin Stjernholm <mast@lysator.liu.se> Date: Tue, 14 May 2002 00:14:05 +0200 Subject: [PATCH] Added some cleanup for dmalloc. Rev: src/main.c:1.147 Rev: src/module_support.c:1.44 Rev: src/module_support.h:1.10 --- src/main.c | 3 ++- src/module_support.c | 13 +++++++++++-- src/module_support.h | 3 ++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main.c b/src/main.c index 9e205c2848..18a346861f 100644 --- a/src/main.c +++ b/src/main.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: main.c,v 1.146 2002/01/27 18:25:43 mast Exp $"); +RCSID("$Id: main.c,v 1.147 2002/05/13 22:14:05 mast Exp $"); #include "fdlib.h" #include "backend.h" #include "module.h" @@ -810,6 +810,7 @@ void low_exit_main(void) exit_cpp(); cleanup_interpret(); cleanup_added_efuns(); + cleanup_module_support(); exit_operators(); exit_iterators(); cleanup_program(); diff --git a/src/module_support.c b/src/module_support.c index a53f5b97c7..1e42a9ac3b 100644 --- a/src/module_support.c +++ b/src/module_support.c @@ -11,7 +11,7 @@ #define sp Pike_sp -RCSID("$Id: module_support.c,v 1.43 2002/05/11 00:29:57 nilsson Exp $"); +RCSID("$Id: module_support.c,v 1.44 2002/05/13 22:14:04 mast Exp $"); /* Checks that args_to_check arguments are OK. * Returns 1 if everything worked ok, zero otherwise. @@ -373,7 +373,6 @@ PMOD_EXPORT void get_all_args(char *fname, INT32 args, char *format, ... ) */ static struct mapping *exported_symbols; -static struct program *function_encapsulation_program; PMOD_EXPORT void pike_module_export_symbol(char *name, int len, @@ -424,3 +423,13 @@ PMOD_EXPORT void *pike_module_import_symbol(char *name, free_string(str); return 0; } + +#ifdef DO_PIKE_CLEANUP +void cleanup_module_support (void) +{ + if (exported_symbols) { + free_mapping (exported_symbols); + exported_symbols = NULL; + } +} +#endif diff --git a/src/module_support.h b/src/module_support.h index 299e33dfff..9113758af7 100644 --- a/src/module_support.h +++ b/src/module_support.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: module_support.h,v 1.9 2002/01/16 02:54:15 nilsson Exp $ + * $Id: module_support.h,v 1.10 2002/05/13 22:14:04 mast Exp $ */ #ifndef MODULE_SUPPORT_H #include <stdarg.h> @@ -50,6 +50,7 @@ PMOD_EXPORT void *pike_module_import_symbol(char *str, int len, char *module, int module_len); +void cleanup_module_support (void); /* Prototypes end here */ #endif -- GitLab