Unlike references, which are best used in moderation, finalizers have essentially no use in a well-written application, with the exception of tidying up native resources.
最好适当地使用引用,收尾器与之不同,除了清理本地资源,它在编写得很好的应用程序中基本没用。
If you're allocating native resources (memory on the native heap, file descriptors, or whatever), it can be significantly more difficult to arrange timely collection of these resources.
如果你分配了native资源,及时回收这些资源是很困难的。
If you're allocating native resources (memory on the native heap, file descriptors, or whatever), it can be significantly more difficult to arrange timely collection of these resources.
如果你分配了native资源,及时回收这些资源是很困难的。
应用推荐