Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit f236670

Browse files
vancemsafern
authored andcommitted
Fix for issue EventSource MultiEnable bug (dotnet/coreclr#14729)
Fixes issue #14728 Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
1 parent d187e30 commit f236670

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/Common/src/CoreLib/System/Diagnostics/Tracing/EventSource.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,8 +2679,16 @@ internal void SendCommand(EventListener listener, int perEventSourceSessionId, i
26792679
else
26802680
{
26812681
// We can't do the command, simply remember it and we do it when we are fully constructed.
2682-
commandArgs.nextCommand = m_deferredCommands;
2683-
m_deferredCommands = commandArgs;
2682+
if (m_deferredCommands == null)
2683+
m_deferredCommands = commandArgs; // create the first entry
2684+
else
2685+
{
2686+
// We have one or more etries, find the last one and add it to that.
2687+
EventCommandEventArgs lastCommand = m_deferredCommands;
2688+
while (lastCommand.nextCommand != null)
2689+
lastCommand = lastCommand.nextCommand;
2690+
lastCommand.nextCommand = commandArgs;
2691+
}
26842692
}
26852693
}
26862694
}
@@ -3190,7 +3198,7 @@ private unsafe bool SendManifest(byte[] rawManifest)
31903198

31913199
Debug.Assert(!SelfDescribingEvents);
31923200

3193-
#if FEATURE_MANAGED_ETW
3201+
#if FEATURE_MANAGED_ETW
31943202
fixed (byte* dataPtr = rawManifest)
31953203
{
31963204
// we don't want the manifest to show up in the event log channels so we specify as keywords

0 commit comments

Comments
 (0)