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

后端 未结 4 2123
我寻月下人不归
我寻月下人不归 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

    Please test the program for memory leaks,Also check autoreleases and whether you are releasing objects properly or not.Also we need to check whether a released object has a memory allocated or not.You also need to be careful regarding autorelease,because accidentally we might release an array or a string or any object that is already autoreleased...hope it helps and works!

    Tip: You can test for leaks by analyzing your project(click shift+command+k)

提交回复
热议问题