views:

22

answers:

3
Dual Search(8896,0xb014b000) malloc: *** error for object 0x5a1e0f0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Thanks!

A: 

Sounds like a double release. I would strongly suggest you look at the rules first. These are critical to know and understand. They'll also help you understand when and for what reasons to call -release, -copy, -retain, etc.

As a quick look, you might be able to catch it by CSA, using build and analyze, but don't hold your breath.

jer
Thank you fro reply,I thought about it so I removed any object release from my codeand still this error
Guy Dor
That doesn't change my suggestion. And removing all -releases is a bad idea. In cases where you think you might be tempted to do that, look at using NSZombiesEnabled instead.
jer
A: 

You can try to set a breakpoint to malloc_error_break, as SDK suggests. To do it, just type "b malloc_error_break" after (gdb) prompt in console at any time after application start. Xcode will stop in debugger at a point where you do your invalid memory release.

A: 

Removing ALL the object releases means that memory you allocate will not be released, hence it will make an impact on memory management. Ensure each allocation of memory you create has a release to go with it.

Jamie Keeling