开发者

"__NSAutoreleaseFreedObject(): release of previously deallocated object" out of the blue

I'm not sure if this is an error or not. The code compiles fine (no warnings), but when I enter a method, a local's value (an NSMutableString) displays this content in the debugger:

__NSAutoreleaseFreedObject(): release of previously dea开发者_开发知识库llocated object

"__NSAutoreleaseFreedObject(): release of previously deallocated object" out of the blue

I'm not getting an exception, it looks like the contents of the string (which is not even allocated at that time) is that NSAutoReleaseFreedObject warning.

What's going on?


If you don't initialize a normal local variable to anything, its value is undefined — it could be anything. In practice, it will interpret the bit pattern that happens to lie on the stack where the variable is allocated as a value of the variable's type. In this case, the "anything" that the variable contains happens to be the address of that string.


it (likely) means that your app has executed different from usual, and exposed a bug in your ref counting of the object. this type of issue can also be related to improper multithreading.

executing your app to trigger the problem with zombies enabled should help you locate it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜