问题描述
我正在使用 Objective-C 编写应用程序,但出现此错误:
MyApp(2121,0xb0185000) malloc: *** error for object 0x1068310: double free
*** 在 malloc_error_break 中设置断点进行调试
当我释放一个 NSAutoreleasePool 并且我无法弄清楚我释放了两次什么对象时就会发生这种情况.
我如何设置他的断点?
有没有办法知道这个对象 0x1068310"是什么?
当您中断调试器时,您会发现对象是什么.只需查看调用堆栈,您就会找到释放它的位置.这会告诉你它是哪个对象.
设置断点的最简单方法是:
- 转到运行 -> 显示 -> 断点(--)
- 滚动到列表底部并添加符号
malloc_error_break
I'm programming an application in Objective-C and I'm getting this error:
It is happening when I release an NSAutoreleasePool and I can't figure out what object I'm releasing twice.
How do I set his breakpoint?
Is there a way to know what is this "object 0x1068310"?
You'll find out what the object is when you break in the debugger. Just look up the call stack and you will find where you free it. That will tell you which object it is.
The easiest way to set the breakpoint is to:
这篇关于如何查找malloc“double free"的原因错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!