Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/coverlet.core/Instrumentation/ModuleTrackerTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ public static void UnloadModule(object sender, EventArgs e)
if (!createdNew)
mutex.WaitOne();

bool failedToCreateNewHitsFile = false;
try
if (!File.Exists(HitsFilePath))
{
using (var fs = new FileStream(HitsFilePath, FileMode.CreateNew))
using (var bw = new BinaryWriter(fs))
Expand All @@ -95,12 +94,7 @@ public static void UnloadModule(object sender, EventArgs e)
}
}
}
catch
{
failedToCreateNewHitsFile = true;
}

if (failedToCreateNewHitsFile)
else
{
// Update the number of hits by adding value on disk with the ones on memory.
// This path should be triggered only in the case of multiple AppDomain unloads.
Expand Down