且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

尝试弹出未知的自动释放池

更新时间:2023-02-17 13:59:54

似乎问题是由漏洞被调用的方法外分配池的事实,即使在同一个线程。这里是NSAutoreleasePool类引用说。

It seems that the issue is caused by the fact that the drain is called outside of the method that allocated the pool even if on the same thread. Here is what NSAutoreleasePool Class Reference says.


你应该在同一上下文中调用一个自动释放

You should always drain an autorelease pool in the same context (invocation of a method or function, or body of a loop) that it was created.

您看到的消息是

[self.downloadAndParsePool drain];

注意:XMLPerformance示例应用程序使用相同的模式定期排空池。它自iOS4.0起也产生此消息

NOTE: XMLPerformance sample app uses the same pattern of periodically draining the pool. It also produces this message since iOS4.0