Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CancelKeyPress event handler should be allocated before TraceEventSession resource acquisition #44

Open
jzabroski opened this issue Mar 20, 2019 · 0 comments

Comments

@jzabroski
Copy link

https://github.com/Microsoft/dotnet-samples/blob/6f2414148e33740c29116138e8bcef28364fafa8/Microsoft.Diagnostics.Tracing/TraceEvent/TraceEvent/10_SimpleEventSourceMonitor.cs#L95

There is a small chance that System.Environment.Exit can be called prior to the event handler being wired up. In this scenario, despite the huge amount of gracious and fantastic warnings about the importance of wiring up this event, the EventTraceSession will hang around after the program has exited. (Thank you to whoever spent the time to write up this fantastic example, by the way - it definitely pointed me in the right direction.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant