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
Post a Comment