Merge pull request #2720 from mono/fix-39325
authormonojenkins <jo.shields+jenkins@xamarin.com>
Sat, 2 Apr 2016 15:50:31 +0000 (16:50 +0100)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Sat, 2 Apr 2016 15:50:31 +0000 (16:50 +0100)
[Profiler] Keep a reference to assemblies while coverage is running

In certain circumstances, for example when running under nunit-console, assemblies could be unloaded while the profiler still had a reference to them in order to generate the coverage data. In these cases, the memory referred to by the profiler would be invalid and would crash.

Fix this by incrementing the reference count of the assemblies preventing them from being unloaded while coverage is being collected.

Fixes BXC #39325

1  2 
mono/profiler/proflog.c

Simple merge