Merge pull request #1857 from slluis/fix-assembly-resolver
[mono.git] / mono / metadata / appdomain.c
index 5fa6706c1907ac9cd3961e02cc4541bf8dbf2250..b3742cb943fceff38b5601b7ae8662ff2c7f2c63 100644 (file)
@@ -78,7 +78,7 @@
  * Changes which are already detected at runtime, like the addition
  * of icalls, do not require an increment.
  */
-#define MONO_CORLIB_VERSION 131
+#define MONO_CORLIB_VERSION 134
 
 typedef struct
 {
@@ -90,8 +90,6 @@ typedef struct
 
 mono_mutex_t mono_delegate_section;
 
-mono_mutex_t mono_strtod_mutex;
-
 static gunichar2 process_guid [36];
 static gboolean process_guid_set = FALSE;
 
@@ -258,12 +256,8 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
        domain->setup = setup;
 
        mono_mutex_init_recursive (&mono_delegate_section);
-
-       mono_mutex_init_recursive (&mono_strtod_mutex);
        
        mono_thread_attach (domain);
-       mono_context_init (domain);
-       mono_context_set (domain->default_context);
 
        mono_type_initialization_init ();
 
@@ -273,6 +267,10 @@ mono_runtime_init (MonoDomain *domain, MonoThreadStartCB start_cb,
        /* GC init has to happen after thread init */
        mono_gc_init ();
 
+       /* contexts use GC handles, so they must be initialized after the GC */
+       mono_context_init (domain);
+       mono_context_set (domain->default_context);
+
 #ifndef DISABLE_SOCKETS
        mono_network_init ();
 #endif