Hacker News new | ask | show | jobs
by zamalek 2528 days ago
> you have to be very careful about events

The only gotcha that can cause memory leaks in C# is a GC root, i.e. referencing something on a stack, that is static or that is pinned. Events/delegates are not special in any way, they are simply a reference footgun because it's non-obvious that they contain a reference to the object that contains the handler.