My application seems to have acquired a slightly odd behaviour when it terminates. When I close a the main window using the standard little red button in the top left the application crashes. I haven't made any changes to the application that would obviously cause this problem. I'm struggling to debug the problem because the application crashes and my debugging skills are limited. Does anyone know any obvious reason why this might occur or a debugging strategy that I might be able to adopt?
+3
A:
If it crashes with EXC_BAD_ACCESS (which sounds likely, although may not be the case - you didn't specify), it is likely something to do with one of your dealloc methods somewhere. The app dealloc's everything right before quitting, so make sure you aren't releasing something that has been autoreleased, for example.
If you are comfortable using GDB, I would try setting breakpoints maybe in something dealloc methods and just see what state the stuff you're releasing may be in.
Crashes like these can be tricky to debug without doing some exploration first to find out what is actually causing the problem.
Joel Levin
2009-02-14 21:31:31
Thanks for the help, just spotted the problem and it was a rogue dealloc. Hopefully my rather silly error might be useful to pointing out the problem to someone else in the future.
Ian Turner
2009-02-14 21:38:00