Branch: Tag:

2003-04-02

2003-04-02 21:03:53 by Martin Stjernholm <mast@lysator.liu.se>

Fixed cleanup order so that e.g. THREADS_ALLOW/DISALLOW can be used in
module exit functions.

Rev: src/main.c:1.172

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: main.c,v 1.171 2003/04/01 19:41:13 mast Exp $ + || $Id: main.c,v 1.172 2003/04/02 21:03:53 mast Exp $   */      #include "global.h" - RCSID("$Id: main.c,v 1.171 2003/04/01 19:41:13 mast Exp $"); + RCSID("$Id: main.c,v 1.172 2003/04/02 21:03:53 mast Exp $");   #include "fdlib.h"   #include "backend.h"   #include "module.h"
836: Inside #if defined(DO_PIKE_CLEANUP)
   * module exit callback. The downside is that the leak report below    * will always report destructed objects. */    cleanup_objects(); +  +  /* Unload dynamic modules before static ones. */ +  exit_dynamic_load();   #endif   }   
848: Inside #if defined(DO_PIKE_CLEANUP)
  #ifdef DO_PIKE_CLEANUP    void exit_iterators(void);    +  /* Clear various global references. */ +    #ifdef AUTO_BIGNUM    exit_auto_bignum();   #endif -  +     exit_pike_searching();    th_cleanup();    exit_object(); -  exit_dynamic_load(); +     exit_signals();    exit_builtin();    exit_cpp();
871: Inside #if defined(DO_PIKE_CLEANUP)
   cleanup_gc();    cleanup_pike_types();    +  /* This zaps Pike_interpreter.thread_state among other things, so +  * THREADS_ALLOW/DISALLOW don't work beyond this point. */ +  th_cleanup(); +    #ifdef SHARED_NODES    free(node_hash.table);   #endif /* SHARED_NODES */
975:       destruct_objects_to_destruct_cb();    +  /* Now there are no arrays/objects/programs/anything left. */ +     really_clean_up_interpret();       cleanup_callbacks();