如果说平台库提供终结器来清除打开的文件句柄,这大大降低了忘记显式地关闭这些句柄的风险,为什么不更多地使用终结器呢?
If the platform libraries provide finalizers for cleaning up open file handlers, which greatly reduces the risk of forgetting to close them explicitly, why aren't finalizers used more often?
如果说平台库提供终结器来清除打开的文件句柄,这大大降低了忘记显式地关闭这些句柄的风险,为什么不更多地使用终结器呢?
If the platform libraries provide finalizers for cleaning up open file handlers, which greatly reduces the risk of forgetting to close them explicitly, why aren't finalizers used more often?
应用推荐