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)
commit0fa33056a6742b2ee02604596b355d661d9bdc41
treec2bf6d0bb015d3010dccfec7a8097e1ce2fa530f
parent8e352357691e6394bbd18e5cd00d95ecaf8bab42
parentd1587ba5e6d9018407907fd9ae78612d5ed761e4
Merge pull request #2720 from mono/fix-39325

[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
mono/profiler/proflog.c