+2003-05-12 Dick Porter <dick@ximian.com>
+
+ * gc.c: Don't run finalizers when the finalizer thread is
+ finishing up, because the default domain has already been
+ destroyed.
+
2003-05-11 Miguel de Icaza <miguel@ximian.com>
* string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
* No need to create another thread 'cause the finalizer thread
* is still working and will take care of running the finalizers
*/
- mono_thread_new_init (GetCurrentThreadId (), todo, NULL);
#if HAVE_BOEHM_GC
GC_gcollect ();
g_message (G_GNUC_PRETTY_FUNCTION ": invoking finalizers");
#endif
- /*
+ /* Can't run finalizers if we're finishing up, because the
+ * domain has already been destroyed
+ *
* There is a bug in GC_invoke_finalizer () in versions <= 6.2alpha4:
* the 'mem_freed' variable is not initialized when there are no
* objects to finalize, which leads to strange behavior later on.
* The check is necessary to work around that bug.
*/
- if (GC_should_invoke_finalizers ())
+ if(!finished && GC_should_invoke_finalizers ()) {
GC_invoke_finalizers ();
+ }
SetEvent (pending_done_event);
}