[Profiler] Use the correct function to increment the refcount
authoriain holmes <iain@xamarin.com>
Wed, 30 Mar 2016 23:23:58 +0000 (00:23 +0100)
committeriain holmes <iain@xamarin.com>
Wed, 30 Mar 2016 23:34:14 +0000 (00:34 +0100)
mono/metadata/metadata-internals.h
mono/profiler/proflog.c

index 57fc425083ef37f62392541ec68810018d0ebe15..6b8fdcb44ca396a788f220bac28c4795f2bd4752 100644 (file)
@@ -774,7 +774,7 @@ gboolean
 mono_metadata_generic_param_equal (MonoGenericParam *p1, MonoGenericParam *p2);
 
 void mono_dynamic_stream_reset  (MonoDynamicStream* stream);
-void mono_assembly_addref       (MonoAssembly *assembly);
+MONO_API void mono_assembly_addref       (MonoAssembly *assembly);
 void mono_assembly_load_friends (MonoAssembly* ass);
 gboolean mono_assembly_has_skip_verification (MonoAssembly* ass);
 
index b68d6a42cf4cb57f1cdc6fe77c6abe78f3560884..c563105892c9c33d35c28f5a3b1447279d015808 100644 (file)
@@ -3703,7 +3703,7 @@ coverage_filter (MonoProfiler *prof, MonoMethod *method)
        // Need to keep the assemblies around for as long as they are kept in the hashtable
        // Nunit, for example, has a habit of unloading them before the coverage statistics are
        // generated causing a crash. See https://bugzilla.xamarin.com/show_bug.cgi?id=39325
-       InterlockedIncrement(&assembly->ref_count);
+       mono_assembly_addref (assembly);
 
        mono_os_mutex_lock (&coverage_mutex);
        mono_conc_hashtable_insert (coverage_methods, method, method);