WeakReference Behavior When Object Is Finalized But Not Yet Garbage Collected

﹥>﹥吖頭↗ 提交于 2019-12-04 08:04:12

If you read all of the documentation for WeakReference, it's clear that there is more than one type of weak reference available. The default is to produce a short weak reference. But you can also create long weak references which specifically account for resurrection scenarios.

From the documentation for TrackResurrection:

Gets an indication whether the object referenced by the current WeakReference object is tracked after it is finalized.

If true, the weak reference is a long weak reference and true was specified for the trackResurrection parameter in the WeakReference constructor.

So I'd say you have to understand this part of weak references before interpreting the IsAlive property.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!