C# - Get number of references to object

前端 未结 5 2027
醉梦人生
醉梦人生 2020-12-05 05:37

I\'m trying to write a simple Resource Manager for the little hobby game I\'m writing. One of the tasks that this resource manager needs to do is unloading unused resources.

5条回答
  •  忘掉有多难
    2020-12-05 06:28

    Ensure the resource manager uses WeakReferences to your resources. That way, when no one else is referencing the resources, they will be eligible for garbage collection.

提交回复
热议问题