diff options
author | Zoltan Varga <vargaz@gmail.com> | 2008-08-03 04:18:48 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2008-08-03 04:18:48 +0400 |
commit | b0ef4ab2c4c78e3eef9d13cccdca16c5680cdfb3 (patch) | |
tree | 1aaa958ef81ca5b4b95bdd9afbd945ae808321a4 /libgc/pthread_support.c | |
parent | cbe103cb5c67b5699c36ed48416b14c52069ecd0 (diff) |
2008-08-03 Zoltan Varga <vargaz@gmail.com>
* pthread_support.c (GC_thread_exit_proc): Null out the tls key to prevent the
dtor function from being callled, since that would read freed memory.
svn path=/trunk/mono/; revision=109502
Diffstat (limited to 'libgc/pthread_support.c')
-rw-r--r-- | libgc/pthread_support.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c index 6306f2cd0ce..7b0c084e8bb 100644 --- a/libgc/pthread_support.c +++ b/libgc/pthread_support.c @@ -1192,6 +1192,11 @@ void GC_thread_exit_proc(void *arg) me = GC_lookup_thread(pthread_self()); GC_destroy_thread_local(me); if (me -> flags & DETACHED) { +# ifdef THREAD_LOCAL_ALLOC + /* NULL out the tls key to prevent the dtor function from being called */ + if (0 != GC_setspecific(GC_thread_key, NULL)) + ABORT("Failed to set thread specific allocation pointers"); +#endif GC_delete_thread(pthread_self()); } else { me -> flags |= FINISHED; |