Merge pull request #2463 from ludovic-henry/monoerror-mono_object_new_pinned
[mono.git] / mono / metadata / appdomain.c
index 540449dc0dd7c556b1b1b415fe2a7fe5f2ba70ed..e35697dd95992ed9979d6e183a21456eeca3dce2 100644 (file)
@@ -1651,7 +1651,6 @@ mono_make_shadow_copy (const char *filename, MonoError *oerror)
        guint32 attrs;
        char *shadow;
        gboolean copy_result;
-       MonoException *exc;
        struct stat src_sbuf;
        struct utimbuf utbuf;
        char *dir_name = g_path_get_dirname (filename);
@@ -2297,6 +2296,7 @@ deregister_reflection_info_roots (MonoDomain *domain)
 static guint32 WINAPI
 unload_thread_main (void *arg)
 {
+       MonoError error;
        unload_data *data = (unload_data*)arg;
        MonoDomain *domain = data->domain;
        MonoThread *thread;
@@ -2304,7 +2304,8 @@ unload_thread_main (void *arg)
 
        /* Have to attach to the runtime so shutdown can wait for this thread */
        /* Force it to be attached to avoid racing during shutdown. */
-       thread = mono_thread_attach_full (mono_get_root_domain (), TRUE);
+       thread = mono_thread_attach_full (mono_get_root_domain (), TRUE, &error);
+       mono_error_raise_exception (&error); /* FIXME don't raise here */
 
        /* 
         * FIXME: Abort our parent thread last, so we can return a failure