Skip to content

Commit

Permalink
Fix for issue EventSource MultiEnable bug (dotnet#14729)
Browse files Browse the repository at this point in the history
Fixes issue #14728
  • Loading branch information
vancem authored Oct 30, 2017
1 parent ffcb012 commit 0c8b4af
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2679,8 +2679,16 @@ internal void SendCommand(EventListener listener, int perEventSourceSessionId, i
else
{
// We can't do the command, simply remember it and we do it when we are fully constructed.
commandArgs.nextCommand = m_deferredCommands;
m_deferredCommands = commandArgs;
if (m_deferredCommands == null)
m_deferredCommands = commandArgs; // create the first entry
else
{
// We have one or more etries, find the last one and add it to that.
EventCommandEventArgs lastCommand = m_deferredCommands;
while (lastCommand.nextCommand != null)
lastCommand = lastCommand.nextCommand;
lastCommand.nextCommand = commandArgs;
}
}
}
}
Expand Down Expand Up @@ -3190,7 +3198,7 @@ private unsafe bool SendManifest(byte[] rawManifest)

Debug.Assert(!SelfDescribingEvents);

#if FEATURE_MANAGED_ETW
#if FEATURE_MANAGED_ETW
fixed (byte* dataPtr = rawManifest)
{
// we don't want the manifest to show up in the event log channels so we specify as keywords
Expand Down

0 comments on commit 0c8b4af

Please sign in to comment.