Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

satyam90

macrumors regular
Original poster
Jul 30, 2007
242
0
Bangalore, India
HI,
I am using Cocoa framework with Obj C.
I am getting following error while closing a window:
iFolder 3(17493,0xa000d000) malloc: *** error for object 0x15d1c4b0: double free
iFolder 3(17493,0xa000d000) malloc: *** set a breakpoint in szone_error to debug

I am not able to find it out from which file and why it is being generated. Infact in all the functions related calling the window (due to which I am getting above error) and inside the code, I am not using "RELEASE" at all.
 

iSee

macrumors 68040
Oct 25, 2004
3,540
272
HI,
I am using Cocoa framework with Obj C.
I am getting following error while closing a window:
iFolder 3(17493,0xa000d000) malloc: *** error for object 0x15d1c4b0: double free
iFolder 3(17493,0xa000d000) malloc: *** set a breakpoint in szone_error to debug

I am not able to find it out from which file and why it is being generated. Infact in all the functions related calling the window (due to which I am getting above error) and inside the code, I am not using "RELEASE" at all.

Do what it says and set a breakpoint in szone_error. The breakpoint will be triggered on the extra call to free. When it's triggered, you'll probably be able to figure out what's wrong by examining the call stack to find out what code is triggering the extra free and thinking about how to avoid it.
When you hit the breakpoint you should be able to seeyou'll be able to look at the call stack and see what the root
 

satyam90

macrumors regular
Original poster
Jul 30, 2007
242
0
Bangalore, India
I am using XCode only to creating user interface. But I am using Makefiles for compiling. So, I cannot set the break point.
I will try to use GDB, what is the procedure to compile .m files for debugging purpose. For example, we need to add "-g" option in unix/linux with C/C++ files to make it useful for debugging.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
How are you not calling release? Are you calling autorelease? If you call autorelease or release twice on an object it will give you that error.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.