Manually destroy C# objects

前端 未结 8 2238
感动是毒
感动是毒 2020-11-29 06:28

I am fairly new to learning C# (from Java & C++ background) and I have a question about manual garbage disposal: is it even possible to manually destroy an object in C#?

8条回答
  •  攒了一身酷
    2020-11-29 06:55

    No, you can't destroy a specific object.

    It is possible to invoke the garbage collector, which will look for objects to destroy, but it's almost never a good idea.

提交回复
热议问题