malloc:***对象0x165060的错误:未释放指针被释放? [英] malloc: *** error for object 0x165060: pointer being freed was not allocated?
问题描述
我有一个应用程序,其中我有一些视频和音频和一些inapp purchase.all r伟大的模拟器和完美工作。但昨天我已经创建了一个应用程序,并试图在它上面运行它从崩溃崩溃。错误报告是
I have an application in which i have some videos and audios and some inapp purchases.all r great in simulator and working perfectly.But yesterday i have created an application and trying to run on it its crashing from the begning.The error report is
malloc: *** error for object 0x165060: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
任何人都可以知道解决方案。我不知道它出错的地方和在模拟器中,它工作得很好。任何人都可以帮助我吗?
can anybody knows the solution .i dont know where it is going wrong and in simulator it is working perfectly.can anybody help me?
推荐答案
你可能会释放一个对象太多次了(例如,调用alloc一次并释放两次)。要找出答案,请查看此问题中的技巧:如何找到malloc的原因double free错误?
You are probably releasing an object too many times (for example, calling alloc once and release twice). To find out where, take a look at the techniques in this question: How to find the cause of a malloc "double free" error?
我个人喜欢 NSZombieEnabled
方法。
另一个提示是,在释放它们之后将变量设置为nil。
Another tip, is to set your variables to nil after you release them.
例如: [bla release]; bla = nil;
这确保您在发布 nil $ c $后不会意外释放它们两次c>什么都不做。
This makes sure you will not accidentally release them twice since releasing nil
does nothing.
这篇关于malloc:***对象0x165060的错误:未释放指针被释放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!