那些支持析构函数或垃圾收集器的语言通过在C接口上作一层封装有助于降低这个问题发生的概率。
Programming languages that support destructors or have a garbage collector may mitigate this problem by making a wrapper over the C interface.
程序员无法控制何时调用析构函数,因为这是由垃圾回收器决定的。
The programmer has no control over when the destructor is called because this is determined by the garbage collector.
调用析构函数时,将调用垃圾回收器来处理该队列。
When the destructor is called, the garbage collector is invoked to process the queue.
应用推荐