c# - Garbage collection of an object that is registerd to an event -


this question has answer here:

i have view object initializes object, creditcard object, , register event creditcard raising. if view object have no reference it. garbage collected? or have unsubscribe in order happen?

you need unsubscribe object garbage collected.

"the cause simple explain: while event handler subscribed, publisher of event holds reference subscriber via event handler delegate (assuming delegate instance method)." - https://stackoverflow.com/a/4526840/283787


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -