iPhone - debugging “pointer being freed was not allocated” errors

后端 未结 4 2109
我寻月下人不归
我寻月下人不归 2020-12-09 21:45

When over freeing a pointer you may see an error such as

\"pointer being freed was not allocated\"

When debugging with the simulator, I add a build argument

4条回答
  •  独厮守ぢ
    2020-12-09 22:33

    Another way to do this. Make sure to turn NSZombie on so it reports the memory address of the object that is getting the extra release. Then Run with Performance Tool->Object Allocations. This will bring up instruments. Look at the Console log as provided by Xcode organizer. Once you get the crash lookup the memory address in instruments. You will see the entire history of mallocs/frees on that object, as well as links straight into your code.

提交回复
热议问题