问题
I am surprised not being able to find anything on the subject.
Garbage collection is not deterministic (it will occur some times later). Does that mean what weak event handlers may (will?) continue being called for object which is not referenced? This could be a reason of problems (performance, disposed object state, etc.), right?
If I must use weak events, is it a good idea (is it enough?) to call GC.Collect()
explicitly to avoid such problems?
P.S.: I have performance problem with some software and trying to fill gaps in my knowledge before attempting something more time-consuming.
来源:https://stackoverflow.com/questions/43890059/gc-and-weak-events