Events in C#: EventHandler, Safe Raising and Subscription Leaks
How the event keyword protects a delegate and CS0070, the private field and add/remove methods the compiler generates, the EventHandler convention and records as event data, safe raising with ?.Invoke, custom add/remove accessors and CS0079, a 50 MB subscription leak measured with WeakReference, and a Subscribe method that returns IDisposable.
7 Nov 2026
·
10 min
·
11