views:

57

answers:

0

I recently came across this extremely useful SO question that explains how a native class can be the consumer of managed events.

I have managed to successfully implement this is our codebase. But we're paranoid about unsubscribing from events we have subscribed to, especailly when there are statics involved as we've been burnt by static delegates holding onto large classes and the GC not collecting them.

But in this case, the delegate is held by a native class, so do we still need to worry about unsubscribing from the event, or when the native class is deleted, will it do it for us, allowing the GC to collect the managed class?